]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Maintain chain invariant in DCE.
authorMike Pall <mike>
Fri, 22 Sep 2023 19:04:22 +0000 (21:04 +0200)
committerMike Pall <mike>
Fri, 22 Sep 2023 19:04:22 +0000 (21:04 +0200)
Thanks to Peter Cawley. #1094

src/lj_opt_dce.c

index c6c3e1bc3429a670056287865c82daf1013959d2..e6fcc552c4731bacc2a720f10bd77591aaadc02d 100644 (file)
@@ -44,12 +44,12 @@ static void dce_propagate(jit_State *J)
     IRIns *ir = IR(ins);
     if (irt_ismarked(ir->t)) {
       irt_clearmark(ir->t);
-      pchain[ir->o] = &ir->prev;
     } else if (!ir_sideeff(ir)) {
       *pchain[ir->o] = ir->prev;  /* Reroute original instruction chain. */
       lj_ir_nop(ir);
       continue;
     }
+    pchain[ir->o] = &ir->prev;
     if (ir->op1 >= REF_FIRST) irt_setmark(IR(ir->op1)->t);
     if (ir->op2 >= REF_FIRST) irt_setmark(IR(ir->op2)->t);
   }