commit e1935d4d16778e4284d981e5de096155b4887128 (tree)
parent ad8c250103b3614525a28fa26260aa338b64065f
Author: Andrew Kelley <andrew@ziglang.org>
Date: Sun, 16 Jul 2023 23:16:51 -0700
InternPool: fix funcAnalysis through func_coerced
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/InternPool.zig b/src/InternPool.zig
@@ -6975,6 +6975,16 @@ pub fn funcAnalysis(ip: *const InternPool, i: Index) *FuncAnalysis {
const extra_index = switch (item.tag) {
.func_decl => item.data + std.meta.fieldIndex(Tag.FuncDecl, "analysis").?,
.func_instance => item.data + std.meta.fieldIndex(Tag.FuncInstance, "analysis").?,
+ .func_coerced => i: {
+ const extra_index = item.data + std.meta.fieldIndex(Tag.FuncCoerced, "func").?;
+ const func_index: Index = @enumFromInt(ip.extra.items[extra_index]);
+ const sub_item = ip.items.get(@intFromEnum(func_index));
+ break :i switch (sub_item.tag) {
+ .func_decl => sub_item.data + std.meta.fieldIndex(Tag.FuncDecl, "analysis").?,
+ .func_instance => sub_item.data + std.meta.fieldIndex(Tag.FuncInstance, "analysis").?,
+ else => unreachable,
+ };
+ },
else => unreachable,
};
return @ptrCast(&ip.extra.items[extra_index]);