From 22099fbb335fd5de86596cca5ac0234f141c140f Mon Sep 17 00:00:00 2001 From: fubark Date: Sun, 11 Feb 2024 22:42:56 -0500 Subject: [PATCH] Fix. --- src/bc_gen.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bc_gen.zig b/src/bc_gen.zig index af9f60e93..dbd256ee4 100644 --- a/src/bc_gen.zig +++ b/src/bc_gen.zig @@ -1924,7 +1924,7 @@ const SetLocalOptions = struct { fn setLocal(c: *Chunk, data: ir.Local, rightIdx: u32, right_t: cy.TypeId, nodeId: cy.NodeId, opts: SetLocalOptions) !void { const reg = toLocalReg(c, data.id); - const local = getLocalInfoPtr(c, reg); + var local = getLocalInfoPtr(c, reg); var dst: Cstr = undefined; if (local.some.lifted) { @@ -1944,7 +1944,8 @@ fn setLocal(c: *Chunk, data: ir.Local, rightIdx: u32, right_t: cy.TypeId, nodeId rightv = try genExpr(c, rightIdx, dst); } - // Update retained state. + // Update retained state. Refetch local. + local = getLocalInfoPtr(c, reg); local.some.rcCandidate = rightv.retained; if (local.some.isDynamic) { local.some.type = right_t;