diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-07-23 17:46:50 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-07-23 17:47:18 -0700 |
| commit | cc6964c5dc7a4d4c3081db06697b8ba0d7900b85 (patch) | |
| tree | 0399e6a434b93734a329452923927f014d9dc99f /src/InternPool.zig | |
| parent | a7f3c2eab427397846f619dba7abb72378ac2ce9 (diff) | |
| download | zig-cc6964c5dc7a4d4c3081db06697b8ba0d7900b85.tar.gz zig-cc6964c5dc7a4d4c3081db06697b8ba0d7900b85.zip | |
InternPool: add func_coerced handling to funcIesResolved
Diffstat (limited to 'src/InternPool.zig')
| -rw-r--r-- | src/InternPool.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/InternPool.zig b/src/InternPool.zig index 0e9e1d4559..8a160d9e39 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -7069,6 +7069,17 @@ pub fn funcIesResolved(ip: *const InternPool, func_index: Index) *Index { const extra_index = switch (tags[@intFromEnum(func_index)]) { .func_decl => func_start + @typeInfo(Tag.FuncDecl).Struct.fields.len, .func_instance => func_start + @typeInfo(Tag.FuncInstance).Struct.fields.len, + .func_coerced => i: { + const uncoerced_func_index: Index = @enumFromInt(ip.extra.items[ + func_start + std.meta.fieldIndex(Tag.FuncCoerced, "func").? + ]); + const uncoerced_func_start = datas[@intFromEnum(uncoerced_func_index)]; + break :i switch (tags[@intFromEnum(uncoerced_func_index)]) { + .func_decl => uncoerced_func_start + @typeInfo(Tag.FuncDecl).Struct.fields.len, + .func_instance => uncoerced_func_start + @typeInfo(Tag.FuncInstance).Struct.fields.len, + else => unreachable, + }; + }, else => unreachable, }; return @ptrCast(&ip.extra.items[extra_index]); |
