From 2681d4abc37c12be96caf614e7671802a105b1a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Thu, 18 Jun 2026 03:54:44 +0200 Subject: [PATCH] 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. --- lib/std/debug/Dwarf/expression.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/debug/Dwarf/expression.zig b/lib/std/debug/Dwarf/expression.zig index 01e44c6700ce113d8c8d361dee2aff8bf58afc0b..9b506dd4da0c1dff4d47711e6b4f367d662edca0 100644 --- a/lib/std/debug/Dwarf/expression.zig +++ b/lib/std/debug/Dwarf/expression.zig @@ -1158,7 +1158,7 @@ test "basics" { // TODO: Test fbreg (once implemented): mock a DIE and point compile_unit.frame_base at it - mem.writeInt(usize, reg_bytes[0..@sizeOf(usize)], 0xee, native_endian); + mem.writeInt(std.debug.cpu_context.Native.Gpr, reg_bytes[0..@sizeOf(std.debug.cpu_context.Native.Gpr)], 0xee, native_endian); (try regNative(&cpu_context, fp_reg_num)).* = 1; (try regNative(&cpu_context, ip_reg_num)).* = 2; @@ -1566,7 +1566,7 @@ test "basics" { context = .{ .cpu_context = &cpu_context }; const reg_bytes = try cpu_context.dwarfRegisterBytes(0); - mem.writeInt(usize, reg_bytes[0..@sizeOf(usize)], 0xee, native_endian); + mem.writeInt(std.debug.cpu_context.Native.Gpr, reg_bytes[0..@sizeOf(std.debug.cpu_context.Native.Gpr)], 0xee, native_endian); var sub_program: std.Io.Writer.Allocating = .init(allocator); defer sub_program.deinit(); -- 2.54.0