aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2014-05-15 17:03:28 +0200
committerMike Pall <mike>2014-05-15 17:03:28 +0200
commit8a38af2f99685eac412d862dd379036ad65cbb6e (patch)
treee7104812f37c3c759b54534f2b648b913437501a /src
parent624260f8318e0a64f4a128f0111a974230d5cb48 (diff)
downloadluajit-8a38af2f99685eac412d862dd379036ad65cbb6e.tar.gz
luajit-8a38af2f99685eac412d862dd379036ad65cbb6e.tar.bz2
luajit-8a38af2f99685eac412d862dd379036ad65cbb6e.zip
Fix FOLD rule for STRREF of SNEW.
Diffstat (limited to 'src')
-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 8a5b41cc..409549c9 100644
--- a/src/lj_opt_fold.c
+++ b/src/lj_opt_fold.c
@@ -505,13 +505,14 @@ LJFOLDF(kfold_strref_snew)
505 } else { 505 } else {
506 /* Reassociate: strref(snew(strref(str, a), len), b) ==> strref(str, a+b) */ 506 /* Reassociate: strref(snew(strref(str, a), len), b) ==> strref(str, a+b) */
507 IRIns *ir = IR(fleft->op1); 507 IRIns *ir = IR(fleft->op1);
508 IRRef1 str = ir->op1; /* IRIns * is not valid across emitir. */ 508 if (ir->o == IR_STRREF) {
509 lua_assert(ir->o == IR_STRREF); 509 IRRef1 str = ir->op1; /* IRIns * is not valid across emitir. */
510 PHIBARRIER(ir); 510 PHIBARRIER(ir);
511 fins->op2 = emitir(IRTI(IR_ADD), ir->op2, fins->op2); /* Clobbers fins! */ 511 fins->op2 = emitir(IRTI(IR_ADD), ir->op2, fins->op2); /* Clobbers fins! */
512 fins->op1 = str; 512 fins->op1 = str;
513 fins->ot = IRT(IR_STRREF, IRT_P32); 513 fins->ot = IRT(IR_STRREF, IRT_P32);
514 return RETRYFOLD; 514 return RETRYFOLD;
515 }
515 } 516 }
516 return NEXTFOLD; 517 return NEXTFOLD;
517} 518}