diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2023-05-29 11:32:12 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-06-10 20:47:56 -0700 |
| commit | 5580a69d714af92883e2031a131c30917162dc15 (patch) | |
| tree | 0670bfea111f650038a883b29588be61a1f31101 /src/Module.zig | |
| parent | a702af062bb65673ba554dba330b4c5ca8d50f3e (diff) | |
| download | zig-5580a69d714af92883e2031a131c30917162dc15.tar.gz zig-5580a69d714af92883e2031a131c30917162dc15.zip | |
cbe: fix InternPool regressions
Diffstat (limited to 'src/Module.zig')
| -rw-r--r-- | src/Module.zig | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Module.zig b/src/Module.zig index 49cf9387a9..22ac947cdf 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -707,8 +707,11 @@ pub const Decl = struct { return TypedValue{ .ty = decl.ty, .val = decl.val }; } - pub fn internValue(decl: Decl, mod: *Module) Allocator.Error!InternPool.Index { - return decl.val.intern(decl.ty, mod); + pub fn internValue(decl: *Decl, mod: *Module) Allocator.Error!InternPool.Index { + assert(decl.has_tv); + const ip_index = try decl.val.intern(decl.ty, mod); + decl.val = ip_index.toValue(); + return ip_index; } pub fn isFunction(decl: Decl, mod: *const Module) !bool { |
