mirror of
https://github.com/php/php-src.git
synced 2026-04-03 06:02:23 +02:00
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.
This commit is contained in:
@@ -340,15 +340,6 @@ optimize_jmpznz:
|
||||
opline->extended_value = ZEND_OPLINE_TO_OFFSET(opline, target);
|
||||
}
|
||||
|
||||
if (ZEND_OP2_JMP_ADDR(opline) == target &&
|
||||
!(opline->op1_type & (IS_VAR|IS_TMP_VAR))) {
|
||||
/* JMPZNZ(?,L,L) -> JMP(L) */
|
||||
opline->opcode = ZEND_JMP;
|
||||
ZEND_SET_OP_JMP_ADDR(opline, opline->op1, target);
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->extended_value = 0;
|
||||
}
|
||||
/* Don't convert JMPZNZ back to JMPZ/JMPNZ, because the
|
||||
following JMP is not removed yet. */
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user