From 5580a69d714af92883e2031a131c30917162dc15 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Mon, 29 May 2023 11:32:12 -0400 Subject: cbe: fix InternPool regressions --- src/Module.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Module.zig') 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 { -- cgit v1.2.3