aboutsummaryrefslogtreecommitdiff
path: root/src/lj_opt_fold.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_opt_fold.c')
-rw-r--r--src/lj_opt_fold.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lj_opt_fold.c b/src/lj_opt_fold.c
index ab963ed4..77293fb5 100644
--- a/src/lj_opt_fold.c
+++ b/src/lj_opt_fold.c
@@ -497,13 +497,14 @@ LJFOLDF(kfold_strref_snew)
497 } else { 497 } else {
498 /* Reassociate: strref(snew(strref(str, a), len), b) ==> strref(str, a+b) */ 498 /* Reassociate: strref(snew(strref(str, a), len), b) ==> strref(str, a+b) */
499 IRIns *ir = IR(fleft->op1); 499 IRIns *ir = IR(fleft->op1);
500 IRRef1 str = ir->op1; /* IRIns * is not valid across emitir. */ 500 if (ir->o == IR_STRREF) {
501 lua_assert(ir->o == IR_STRREF); 501 IRRef1 str = ir->op1; /* IRIns * is not valid across emitir. */
502 PHIBARRIER(ir); 502 PHIBARRIER(ir);
503 fins->op2 = emitir(IRTI(IR_ADD), ir->op2, fins->op2); /* Clobbers fins! */ 503 fins->op2 = emitir(IRTI(IR_ADD), ir->op2, fins->op2); /* Clobbers fins! */
504 fins->op1 = str; 504 fins->op1 = str;
505 fins->ot = IRT(IR_STRREF, IRT_P32); 505 fins->ot = IRT(IR_STRREF, IRT_P32);
506 return RETRYFOLD; 506 return RETRYFOLD;
507 }
507 } 508 }
508 return NEXTFOLD; 509 return NEXTFOLD;
509} 510}