authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-16 23:16:51-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-18 19:02:06-07:00
loge1935d4d16778e4284d981e5de096155b4887128
tree24cfe2c53dc46247da1f33aa8747acbb3359a989
parentad8c250103b3614525a28fa26260aa338b64065f

InternPool: fix funcAnalysis through func_coerced


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

src/InternPool.zig+10
...@@ -6975,6 +6975,16 @@ pub fn funcAnalysis(ip: *const InternPool, i: Index) *FuncAnalysis {...@@ -6975,6 +6975,16 @@ pub fn funcAnalysis(ip: *const InternPool, i: Index) *FuncAnalysis {
6975 const extra_index = switch (item.tag) {6975 const extra_index = switch (item.tag) {
6976 .func_decl => item.data + std.meta.fieldIndex(Tag.FuncDecl, "analysis").?,6976 .func_decl => item.data + std.meta.fieldIndex(Tag.FuncDecl, "analysis").?,
6977 .func_instance => item.data + std.meta.fieldIndex(Tag.FuncInstance, "analysis").?,6977 .func_instance => item.data + std.meta.fieldIndex(Tag.FuncInstance, "analysis").?,
6978 .func_coerced => i: {
6979 const extra_index = item.data + std.meta.fieldIndex(Tag.FuncCoerced, "func").?;
6980 const func_index: Index = @enumFromInt(ip.extra.items[extra_index]);
6981 const sub_item = ip.items.get(@intFromEnum(func_index));
6982 break :i switch (sub_item.tag) {
6983 .func_decl => sub_item.data + std.meta.fieldIndex(Tag.FuncDecl, "analysis").?,
6984 .func_instance => sub_item.data + std.meta.fieldIndex(Tag.FuncInstance, "analysis").?,
6985 else => unreachable,
6986 };
6987 },
6978 else => unreachable,6988 else => unreachable,
6979 };6989 };
6980 return @ptrCast(&ip.extra.items[extra_index]);6990 return @ptrCast(&ip.extra.items[extra_index]);