Skip to content

Commit

Permalink
Fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
fubark committed Feb 12, 2024
1 parent 0d5eec5 commit 22099fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/bc_gen.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit 22099fb

Please sign in to comment.