aboutsummaryrefslogtreecommitdiff
path: root/src-self-hosted
diff options
context:
space:
mode:
Diffstat (limited to 'src-self-hosted')
-rw-r--r--src-self-hosted/ir/text.zig17
1 files changed, 16 insertions, 1 deletions
diff --git a/src-self-hosted/ir/text.zig b/src-self-hosted/ir/text.zig
index e0cc4e122c..d8b5af4e2c 100644
--- a/src-self-hosted/ir/text.zig
+++ b/src-self-hosted/ir/text.zig
@@ -1456,6 +1456,21 @@ const EmitZIR = struct {
.kw_args = .{},
};
try self.decls.append(self.allocator, &str_inst.base);
- return &str_inst.base;
+
+ const ref_inst = try self.arena.allocator.create(Inst.Ref);
+ ref_inst.* = .{
+ .base = .{
+ .name = try self.autoName(),
+ .src = src,
+ .tag = Inst.Ref.base_tag,
+ },
+ .positionals = .{
+ .operand = &str_inst.base,
+ },
+ .kw_args = .{},
+ };
+ try self.decls.append(self.allocator, &ref_inst.base);
+
+ return &ref_inst.base;
}
};