mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Fix FOLD rule for STRREF of SNEW.
This commit is contained in:
parent
624260f831
commit
8a38af2f99
@ -505,14 +505,15 @@ LJFOLDF(kfold_strref_snew)
|
||||
} else {
|
||||
/* Reassociate: strref(snew(strref(str, a), len), b) ==> strref(str, a+b) */
|
||||
IRIns *ir = IR(fleft->op1);
|
||||
if (ir->o == IR_STRREF) {
|
||||
IRRef1 str = ir->op1; /* IRIns * is not valid across emitir. */
|
||||
lua_assert(ir->o == IR_STRREF);
|
||||
PHIBARRIER(ir);
|
||||
fins->op2 = emitir(IRTI(IR_ADD), ir->op2, fins->op2); /* Clobbers fins! */
|
||||
fins->op1 = str;
|
||||
fins->ot = IRT(IR_STRREF, IRT_P32);
|
||||
return RETRYFOLD;
|
||||
}
|
||||
}
|
||||
return NEXTFOLD;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user