diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2023-11-30 14:27:18 -0500 |
|---|---|---|
| committer | Matthew Lugg <mlugg@mlugg.co.uk> | 2023-12-01 04:34:50 +0000 |
| commit | bf5ab54510fd8fbd300ddc22f9af4767477be0e5 (patch) | |
| tree | 94fb2ce98befdd0a8b80abaf54280e83a748b652 /src/arch/x86_64/CodeGen.zig | |
| parent | 39a966b0a496b683d0ac0d1b04dc851caa655a23 (diff) | |
| download | zig-bf5ab54510fd8fbd300ddc22f9af4767477be0e5.tar.gz zig-bf5ab54510fd8fbd300ddc22f9af4767477be0e5.zip | |
test: test with `-fstrip` and fix failures
Closes #17513
Diffstat (limited to 'src/arch/x86_64/CodeGen.zig')
| -rw-r--r-- | src/arch/x86_64/CodeGen.zig | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/arch/x86_64/CodeGen.zig b/src/arch/x86_64/CodeGen.zig index 478a1f7120..fbe7791336 100644 --- a/src/arch/x86_64/CodeGen.zig +++ b/src/arch/x86_64/CodeGen.zig @@ -7083,15 +7083,14 @@ fn fieldPtr(self: *Self, inst: Air.Inst.Index, operand: Air.Inst.Ref, index: u32 const ptr_container_ty_info = ptr_container_ty.ptrInfo(mod); const container_ty = ptr_container_ty.childType(mod); - const field_offset: i32 = blk: { - if (mod.typeToPackedStruct(container_ty)) |struct_type| { - break :blk if (ptr_field_ty.ptrInfo(mod).packed_offset.host_size == 0) - @divExact(mod.structPackedFieldBitOffset(struct_type, index) + ptr_container_ty_info.packed_offset.bit_offset, 8) - else - 0; - } - break :blk @intCast(container_ty.structFieldOffset(index, mod)); - }; + const field_offset: i32 = if (mod.typeToPackedStruct(container_ty)) |struct_obj| + if (ptr_field_ty.ptrInfo(mod).packed_offset.host_size == 0) + @divExact(mod.structPackedFieldBitOffset(struct_obj, index) + + ptr_container_ty_info.packed_offset.bit_offset, 8) + else + 0 + else + @intCast(container_ty.structFieldOffset(index, mod)); const src_mcv = try self.resolveInst(operand); const dst_mcv = if (switch (src_mcv) { |
