riscv: fix logic bug in ptr_elem_ptr

I was doing duplicate work with `elemOffset` multiplying by the abi size and then the `ptr_add` `genBinOp` also multiplying.

This led to having writes happening in the wrong place.
This commit is contained in:
David Rubin
2024-07-15 03:37:06 -07:00
parent cde6956b21
commit 81ca3a1d59
8 changed files with 6 additions and 35 deletions

View File

@@ -620,7 +620,6 @@ var global_ptr = &gdt[0];
test "global constant is loaded with a runtime-known index" {
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
const S = struct {
fn doTheTest() !void {