authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-05-23 19:49:18-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-10 20:47:54-07:00
log5555bdca047f8dbf8d7adfa8f248f5ce9b692b9e
tree04b34d5ecdb0afc6650656ce396ba17333e948d5
parent20522600399fb38e8e220cab0f8f59234725b9f1

InternPool: support int->comptime_int in getCoerced


1 files changed, 6 insertions(+), 0 deletions(-)

src/InternPool.zig+6
...@@ -3754,6 +3754,7 @@ pub fn getCoerced(ip: *InternPool, gpa: Allocator, val: Index, new_ty: Index) Al...@@ -3754,6 +3754,7 @@ pub fn getCoerced(ip: *InternPool, gpa: Allocator, val: Index, new_ty: Index) Al
3754 .c_ulong,3754 .c_ulong,
3755 .c_longlong,3755 .c_longlong,
3756 .c_ulonglong,3756 .c_ulonglong,
3757 .comptime_int,
3757 => return getCoercedInts(ip, gpa, int, new_ty),3758 => return getCoercedInts(ip, gpa, int, new_ty),
3758 else => {},3759 else => {},
3759 },3760 },
...@@ -3790,6 +3791,11 @@ pub fn getCoerced(ip: *InternPool, gpa: Allocator, val: Index, new_ty: Index) Al...@@ -3790,6 +3791,11 @@ pub fn getCoerced(ip: *InternPool, gpa: Allocator, val: Index, new_ty: Index) Al
3790 },3791 },
3791 else => {},3792 else => {},
3792 }3793 }
3794 if (std.debug.runtime_safety) {
3795 std.debug.panic("val={any} new_ty={any}\n", .{
3796 ip.items.get(@enumToInt(val)), ip.items.get(@enumToInt(new_ty)),
3797 });
3798 }
3793 unreachable;3799 unreachable;
3794}3800}
37953801