authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-06-18 03:54:44+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-06-18 03:59:15+02:00
log2681d4abc37c12be96caf614e7671802a105b1a2
tree168583150a0ff3077b96e7c6f1ae92d7d08e7950
parent6aaea5af415a821ee134b23cc468d32695c3063d
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.debug.Dwarf.expression: fix a couple of failing tests on x32/n32

The upper half of the register was left undefined on these ABIs, causing an @intCast inside the stack machine to fail.

1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/debug/Dwarf/expression.zig+2-2
......@@ -1158,7 +1158,7 @@ test "basics" {
11581158
11591159 // TODO: Test fbreg (once implemented): mock a DIE and point compile_unit.frame_base at it
11601160
1161 mem.writeInt(usize, reg_bytes[0..@sizeOf(usize)], 0xee, native_endian);
1161 mem.writeInt(std.debug.cpu_context.Native.Gpr, reg_bytes[0..@sizeOf(std.debug.cpu_context.Native.Gpr)], 0xee, native_endian);
11621162 (try regNative(&cpu_context, fp_reg_num)).* = 1;
11631163 (try regNative(&cpu_context, ip_reg_num)).* = 2;
11641164
......@@ -1566,7 +1566,7 @@ test "basics" {
15661566 context = .{ .cpu_context = &cpu_context };
15671567
15681568 const reg_bytes = try cpu_context.dwarfRegisterBytes(0);
1569 mem.writeInt(usize, reg_bytes[0..@sizeOf(usize)], 0xee, native_endian);
1569 mem.writeInt(std.debug.cpu_context.Native.Gpr, reg_bytes[0..@sizeOf(std.debug.cpu_context.Native.Gpr)], 0xee, native_endian);
15701570
15711571 var sub_program: std.Io.Writer.Allocating = .init(allocator);
15721572 defer sub_program.deinit();