Commit 076b54c8e7
Changed files (1)
src
src/value.zig
@@ -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 {