Skip to content

Commit 7d2f2a1

Browse files
committed
Remove an incorrect JMPZNZ optimization
This is already skipped for TMP/VAR, but also needs to be skipped for CV, because we need to insert CHECK_VAR in that case, if we're being pedantic. That leaves us with CONST as the only case we can handle, which is already covered by constant folding. This optimization never actually triggers in our tests, so it's not a big loss.
1 parent a0ba104 commit 7d2f2a1

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

Zend/Optimizer/pass3.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -340,15 +340,6 @@ void zend_optimizer_pass3(zend_op_array *op_array, zend_optimizer_ctx *ctx)
340340
opline->extended_value = ZEND_OPLINE_TO_OFFSET(opline, target);
341341
}
342342

343-
if (ZEND_OP2_JMP_ADDR(opline) == target &&
344-
!(opline->op1_type & (IS_VAR|IS_TMP_VAR))) {
345-
/* JMPZNZ(?,L,L) -> JMP(L) */
346-
opline->opcode = ZEND_JMP;
347-
ZEND_SET_OP_JMP_ADDR(opline, opline->op1, target);
348-
SET_UNUSED(opline->op1);
349-
SET_UNUSED(opline->op2);
350-
opline->extended_value = 0;
351-
}
352343
/* Don't convert JMPZNZ back to JMPZ/JMPNZ, because the
353344
following JMP is not removed yet. */
354345
break;

0 commit comments

Comments
 (0)