diff options
author | Mike Pall <mike> | 2021-04-20 17:55:48 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2021-04-20 17:59:47 +0200 |
commit | de772054904054af077d6f448681810e8cc1520d (patch) | |
tree | 307233151977ab10b838399a66a0d255f958ece4 /src | |
parent | 5374a0a3cfa5e4627e2de028da8923de3921ad0a (diff) | |
download | luajit-de772054904054af077d6f448681810e8cc1520d.tar.gz luajit-de772054904054af077d6f448681810e8cc1520d.tar.bz2 luajit-de772054904054af077d6f448681810e8cc1520d.zip |
Fix IR_RENAME snapshot number. Follow-up fix for a32aeadc.
Reported by Victor Bombi, analyzed by XmiliaH. Thanks!
Diffstat (limited to 'src')
-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 | ||