Commit fc3ff26237

mlugg <mlugg@mlugg.co.uk>
2023-09-16 00:17:56
TypedValue: print undef @ptrFromInt pointers correctly
1 parent 0710314
Changed files (1)
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,
                     }
                 }