mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
frontend: fix wrong result of Value.getFunction
Fixes regression introduced in
db33ee45b7.
Found from compiling bun. Unfortunately we do not have a behavior test
reduction for this bug.
This commit is contained in:
parent
1ae839cd24
commit
076b54c8e7
1 changed files with 2 additions and 2 deletions
|
|
@ -483,10 +483,10 @@ pub const Value = struct {
|
|||
}
|
||||
|
||||
pub fn getFunction(val: Value, mod: *Module) ?InternPool.Key.Func {
|
||||
return switch (mod.intern_pool.indexToKey(val.toIntern())) {
|
||||
return if (val.ip_index != .none) switch (mod.intern_pool.indexToKey(val.toIntern())) {
|
||||
.func => |x| x,
|
||||
else => null,
|
||||
};
|
||||
} else null;
|
||||
}
|
||||
|
||||
pub fn getExternFunc(val: Value, mod: *Module) ?InternPool.Key.ExternFunc {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue