diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2022-03-01 22:03:18 +0100 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2022-03-01 22:03:18 +0100 |
| commit | e8eb9778cccd2f2d23027d9e0d73d7053bf92efe (patch) | |
| tree | a658c7381f29593222e059ad541d006afd9e310c /src/arch | |
| parent | 543bee0adf2d3b036654fa0983c16ff7023f504c (diff) | |
| download | zig-e8eb9778cccd2f2d23027d9e0d73d7053bf92efe.tar.gz zig-e8eb9778cccd2f2d23027d9e0d73d7053bf92efe.zip | |
codegen: lower field_ptr to memory across linking backends
This requires generating an addend for the target relocation as
the field pointer might point at a field inner to the container.
Diffstat (limited to 'src/arch')
| -rw-r--r-- | src/arch/x86_64/CodeGen.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/arch/x86_64/CodeGen.zig b/src/arch/x86_64/CodeGen.zig index c1d1c6863e..c511a26eac 100644 --- a/src/arch/x86_64/CodeGen.zig +++ b/src/arch/x86_64/CodeGen.zig @@ -2565,7 +2565,8 @@ fn store(self: *Self, ptr: MCValue, value: MCValue, ptr_ty: Type, value_ty: Type const payload = try self.addExtra(Mir.ImmPair{ .dest_off = 0, - .operand = @intCast(u32, imm), + // TODO check if this logic is correct + .operand = @truncate(u32, imm), }); const flags: u2 = switch (abi_size) { 1 => 0b00, |
