diff options
-rw-r--r-- | src/lj_asm.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c index db180315..8dfe4dd0 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c | |||
@@ -697,7 +697,14 @@ static void ra_rename(ASMState *as, Reg down, Reg up) | |||
697 | RA_DBGX((as, "rename $f $r $r", regcost_ref(as->cost[up]), down, up)); | 697 | RA_DBGX((as, "rename $f $r $r", regcost_ref(as->cost[up]), down, up)); |
698 | emit_movrr(as, ir, down, up); /* Backwards codegen needs inverse move. */ | 698 | emit_movrr(as, ir, down, up); /* Backwards codegen needs inverse move. */ |
699 | if (!ra_hasspill(IR(ref)->s)) { /* Add the rename to the IR. */ | 699 | if (!ra_hasspill(IR(ref)->s)) { /* Add the rename to the IR. */ |
700 | ra_addrename(as, down, ref, as->snapno); | 700 | /* |
701 | ** The rename is effective at the subsequent (already emitted) exit | ||
702 | ** branch. This is for the current snapshot (as->snapno). Except if we | ||
703 | ** haven't yet allocated any refs for the snapshot (as->snapalloc == 1), | ||
704 | ** then it belongs to the next snapshot. | ||
705 | ** See also the discussion at asm_snap_checkrename(). | ||
706 | */ | ||
707 | ra_addrename(as, down, ref, as->snapno + as->snapalloc); | ||
701 | } | 708 | } |
702 | } | 709 | } |
703 | 710 | ||