diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lj_opt_fold.c | 15 |
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 | } |
