Fix FOLD rule for BUFHDR append.

Reported by XmiliaH.
master
Mike Pall 2022-01-13 18:33:04 +01:00
parent be251d9149
commit bc1bdbf620
1 changed files with 2 additions and 1 deletions

View File

@ -597,7 +597,8 @@ LJFOLDF(bufput_bufstr)
/* New buffer, no other buffer op inbetween and same buffer? */
if (fleft->o == IR_BUFHDR && fleft->op2 == IRBUFHDR_RESET &&
fleft->prev == hdr &&
fleft->op1 == IR(hdr)->op1) {
fleft->op1 == IR(hdr)->op1 &&
!(irt_isphi(fright->t) && IR(hdr)->prev)) {
IRRef ref = fins->op1;
IR(ref)->op2 = IRBUFHDR_APPEND; /* Modify BUFHDR. */
IR(ref)->op1 = fright->op1;