mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
TypedValue: fix debug print crashes
This commit is contained in:
parent
be1b231206
commit
84099e50fc
@ -295,6 +295,9 @@ pub fn print(
|
||||
},
|
||||
.eu_payload_ptr => {
|
||||
try writer.writeAll("&");
|
||||
if (level == 0) {
|
||||
return writer.writeAll("(ptr)");
|
||||
}
|
||||
|
||||
const data = val.castTag(.eu_payload_ptr).?.data;
|
||||
|
||||
@ -320,6 +323,10 @@ pub fn print(
|
||||
return;
|
||||
},
|
||||
.opt_payload_ptr => {
|
||||
if (level == 0) {
|
||||
return writer.writeAll("&(ptr)");
|
||||
}
|
||||
|
||||
const data = val.castTag(.opt_payload_ptr).?.data;
|
||||
|
||||
var ty_val: Value.Payload.Ty = .{
|
||||
@ -359,6 +366,10 @@ pub fn print(
|
||||
inline .u64, .i64, .big_int => |x| return writer.print("{}", .{x}),
|
||||
},
|
||||
.enum_tag => |enum_tag| {
|
||||
if (level == 0) {
|
||||
return writer.writeAll("(enum)");
|
||||
}
|
||||
|
||||
try writer.writeAll("@intToEnum(");
|
||||
try print(.{
|
||||
.ty = Type.type,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user