mirror of
https://github.com/ziglang/zig.git
synced 2024-11-17 09:32:51 +00:00
stage2 codegen: fix airBlock bug in 3 backends
This commit is contained in:
parent
a1526f069a
commit
b5f03b3b7a
@ -2104,17 +2104,16 @@ fn airBlock(self: *Self, inst: Air.Inst.Index) !void {
|
||||
// block results.
|
||||
.mcv = MCValue{ .none = {} },
|
||||
});
|
||||
const block_data = self.blocks.getPtr(inst).?;
|
||||
defer block_data.relocs.deinit(self.gpa);
|
||||
defer self.blocks.getPtr(inst).?.relocs.deinit(self.gpa);
|
||||
|
||||
const ty_pl = self.air.instructions.items(.data)[inst].ty_pl;
|
||||
const extra = self.air.extraData(Air.Block, ty_pl.payload);
|
||||
const body = self.air.extra[extra.end..][0..extra.data.body_len];
|
||||
try self.genBody(body);
|
||||
|
||||
for (block_data.relocs.items) |reloc| try self.performReloc(reloc);
|
||||
for (self.blocks.getPtr(inst).?.relocs.items) |reloc| try self.performReloc(reloc);
|
||||
|
||||
const result = @bitCast(MCValue, block_data.mcv);
|
||||
const result = self.blocks.getPtr(inst).?.mcv;
|
||||
return self.finishAir(inst, result, .{ .none, .none, .none });
|
||||
}
|
||||
|
||||
|
@ -1720,17 +1720,16 @@ fn airBlock(self: *Self, inst: Air.Inst.Index) !void {
|
||||
// block results.
|
||||
.mcv = MCValue{ .none = {} },
|
||||
});
|
||||
const block_data = self.blocks.getPtr(inst).?;
|
||||
defer block_data.relocs.deinit(self.gpa);
|
||||
defer self.blocks.getPtr(inst).?.relocs.deinit(self.gpa);
|
||||
|
||||
const ty_pl = self.air.instructions.items(.data)[inst].ty_pl;
|
||||
const extra = self.air.extraData(Air.Block, ty_pl.payload);
|
||||
const body = self.air.extra[extra.end..][0..extra.data.body_len];
|
||||
try self.genBody(body);
|
||||
|
||||
for (block_data.relocs.items) |reloc| try self.performReloc(reloc);
|
||||
for (self.blocks.getPtr(inst).?.relocs.items) |reloc| try self.performReloc(reloc);
|
||||
|
||||
const result = @bitCast(MCValue, block_data.mcv);
|
||||
const result = self.blocks.getPtr(inst).?.mcv;
|
||||
return self.finishAir(inst, result, .{ .none, .none, .none });
|
||||
}
|
||||
|
||||
|
@ -2853,17 +2853,16 @@ fn airBlock(self: *Self, inst: Air.Inst.Index) !void {
|
||||
// block results.
|
||||
.mcv = MCValue{ .none = {} },
|
||||
});
|
||||
const block_data = self.blocks.getPtr(inst).?;
|
||||
defer block_data.relocs.deinit(self.gpa);
|
||||
defer self.blocks.getPtr(inst).?.relocs.deinit(self.gpa);
|
||||
|
||||
const ty_pl = self.air.instructions.items(.data)[inst].ty_pl;
|
||||
const extra = self.air.extraData(Air.Block, ty_pl.payload);
|
||||
const body = self.air.extra[extra.end..][0..extra.data.body_len];
|
||||
try self.genBody(body);
|
||||
|
||||
for (block_data.relocs.items) |reloc| try self.performReloc(reloc);
|
||||
for (self.blocks.getPtr(inst).?.relocs.items) |reloc| try self.performReloc(reloc);
|
||||
|
||||
const result = @bitCast(MCValue, block_data.mcv);
|
||||
const result = self.blocks.getPtr(inst).?.mcv;
|
||||
return self.finishAir(inst, result, .{ .none, .none, .none });
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user