diff --git a/NEWS b/NEWS index 29b5d08fb05..9953a673164 100644 --- a/NEWS +++ b/NEWS @@ -37,6 +37,9 @@ PHP NEWS microseconds/fractions). (Andrew Nester) . Fixed bug #74433 (wrong reflection for Normalizer methods). (villfa) +- Opcache: + . Fixed bug #74431 (foreach infinite loop). (Nikita) + - OpenSSL: . Fixed bug #74341 (openssl_x509_parse fails to parse ASN.1 UTCTime without seconds). (Moritz Fain) diff --git a/ext/opcache/Optimizer/dfa_pass.c b/ext/opcache/Optimizer/dfa_pass.c index 55915e70a94..4e4260660c0 100644 --- a/ext/opcache/Optimizer/dfa_pass.c +++ b/ext/opcache/Optimizer/dfa_pass.c @@ -162,8 +162,12 @@ static void zend_ssa_remove_nops(zend_op_array *op_array, zend_ssa *ssa) zend_op *opline; zend_op *new_opline; - opline = op_array->opcodes + end - 1; b->len = target - b->start; + opline = op_array->opcodes + end - 1; + if (opline->opcode == ZEND_NOP) { + continue; + } + new_opline = op_array->opcodes + target - 1; switch (new_opline->opcode) { case ZEND_JMP: