From fc3ff262374c704a01a5f8a8b0cd721e3b61a9c8 Mon Sep 17 00:00:00 2001 From: mlugg Date: Fri, 15 Sep 2023 23:17:56 +0100 Subject: [PATCH] TypedValue: print undef @ptrFromInt pointers correctly --- src/TypedValue.zig | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/TypedValue.zig b/src/TypedValue.zig index 9b7f3d7e7b..c2be851d15 100644 --- a/src/TypedValue.zig +++ b/src/TypedValue.zig @@ -257,9 +257,12 @@ pub fn print( }, .ptr => |ptr| { if (ptr.addr == .int) { - const i = ip.indexToKey(ptr.addr.int).int; - switch (i.storage) { - inline else => |addr| return writer.print("{x:0>8}", .{addr}), + switch (ip.indexToKey(ptr.addr.int)) { + .int => |i| switch (i.storage) { + inline else => |addr| return writer.print("{x:0>8}", .{addr}), + }, + .undef => return writer.writeAll("undefined"), + else => unreachable, } }