mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 03:24:46 +01:00
x86_64: hack around more OPV bugs
I would just fix this in Sema if it were easy to do so, but this is more like a (minor) AIR data design issue than a straightforward Sema bug.
This commit is contained in:
parent
b27bdd5af0
commit
3f08073f7d
1 changed files with 8 additions and 6 deletions
|
|
@ -171444,12 +171444,14 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
|
|||
const elem_dies = bt.feed();
|
||||
if (tuple_type.values.get(ip)[field_index] != .none) continue;
|
||||
const field_type = Type.fromInterned(tuple_type.types.get(ip)[field_index]);
|
||||
elem_disp = @intCast(field_type.abiAlignment(zcu).forward(elem_disp));
|
||||
var elem = try cg.tempFromOperand(elem_ref, elem_dies);
|
||||
try res.write(&elem, .{ .disp = elem_disp }, cg);
|
||||
try elem.die(cg);
|
||||
try cg.resetTemps(reset_index);
|
||||
elem_disp += @intCast(field_type.abiSize(zcu));
|
||||
if (!hack_around_sema_opv_bugs or field_type.hasRuntimeBitsIgnoreComptime(zcu)) {
|
||||
elem_disp = @intCast(field_type.abiAlignment(zcu).forward(elem_disp));
|
||||
var elem = try cg.tempFromOperand(elem_ref, elem_dies);
|
||||
try res.write(&elem, .{ .disp = elem_disp }, cg);
|
||||
try elem.die(cg);
|
||||
try cg.resetTemps(reset_index);
|
||||
elem_disp += @intCast(field_type.abiSize(zcu));
|
||||
}
|
||||
}
|
||||
},
|
||||
else => return cg.fail("failed to select {s} {f}", .{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue