authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-22 19:57:23-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-22 19:57:23-07:00
log076b54c8e7e8472556558543c6fb3eaa8967de78
treeba4beccf8f871b30fbfcf7268cfae0ad8c12b2a0
parent1ae839cd248c9eee8a9ff0643d7b80628f5f5533

frontend: fix wrong result of Value.getFunction

Fixes regression introduced in db33ee45b7261c9ec62a1087cfc9377bc4e7aa8f. Found from compiling bun. Unfortunately we do not have a behavior test reduction for this bug.

1 files changed, 2 insertions(+), 2 deletions(-)

src/value.zig+2-2
......@@ -483,10 +483,10 @@ pub const Value = struct {
483483 }
484484
485485 pub fn getFunction(val: Value, mod: *Module) ?InternPool.Key.Func {
486 return switch (mod.intern_pool.indexToKey(val.toIntern())) {
486 return if (val.ip_index != .none) switch (mod.intern_pool.indexToKey(val.toIntern())) {
487487 .func => |x| x,
488488 else => null,
489 };
489 } else null;
490490 }
491491
492492 pub fn getExternFunc(val: Value, mod: *Module) ?InternPool.Key.ExternFunc {