]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Prevent replay of buffer operation for PHI operands.
authorMike Pall <mike>
Sun, 16 Jan 2022 20:00:24 +0000 (21:00 +0100)
committerMike Pall <mike>
Sun, 16 Jan 2022 20:00:24 +0000 (21:00 +0100)
Contributed by XmiliaH.

src/lj_opt_fold.c

index e3fe8bbf13c481882b04937c794a786e5fcd3bfe..0c5a4a6a611aaec3b71cb5c7d7490d7757f32cde 100644 (file)
@@ -605,7 +605,7 @@ LJFOLDF(bufput_bufstr)
       return ref;
     }
     /* Replay puts to global temporary buffer. */
-    if (IR(hdr)->op2 == IRBUFHDR_RESET) {
+    if (IR(hdr)->op2 == IRBUFHDR_RESET && !irt_isphi(fright->t)) {
       IRIns *ir = IR(fright->op1);
       /* For now only handle single string.reverse .lower .upper .rep. */
       if (ir->o == IR_CALLL &&