Merge branch 'PHP-8.4'

* PHP-8.4:
  Fix GH-17428: Assertion failure ext/opcache/jit/zend_jit_ir.c:8940
This commit is contained in:
Niels Dossche 2025-01-14 22:38:18 +01:00
commit 650e59a1c2
No known key found for this signature in database
GPG key ID: B8A8AD166DF0E2E5
2 changed files with 38 additions and 3 deletions

View file

@ -2760,8 +2760,8 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
/* THROW and EXIT may be used in the middle of BB */ /* THROW and EXIT may be used in the middle of BB */
/* don't generate code for the rest of BB */ /* don't generate code for the rest of BB */
/* Skip current opline for call_level computation /* Skip current opline for call_level computation because it does not influence call_level.
* Don't include last opline because end of loop already checks call level of last opline */ * Don't include last opline because end of loop already checks call level of last opline. */
i++; i++;
for (; i < end; i++) { for (; i < end; i++) {
opline = op_array->opcodes + i; opline = op_array->opcodes + i;
@ -2771,7 +2771,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
call_level--; call_level--;
} }
} }
opline = op_array->opcodes + i; opline = op_array->opcodes + end;
break; break;
/* stackless execution */ /* stackless execution */
case ZEND_INCLUDE_OR_EVAL: case ZEND_INCLUDE_OR_EVAL:

View file

@ -0,0 +1,35 @@
--TEST--
GH-17428 (Assertion failure ext/opcache/jit/zend_jit_ir.c:8940)
--EXTENSIONS--
opcache
--INI--
opcache.jit=1205
--FILE--
<?php
new EmptyIterator();
srand(1000);
error_reporting(E_ALL);
testConversion('', '');
testConversion('', '');
testConversion('', '');
testConversion('', '');
testConversion('', '');
function testRoundTrip($data) {
}
for ($iterations = 0; $iterations < 100; $iterations++) {
$strlen = rand(1, 100);
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randstring = '';
for ($i = 0; $i < $strlen; $i++) {
$randstring .= $characters[rand(0, strlen($characters) - 1)];
}
die($randstring);
}
echo "Done!\n";
throw new Hello(new stdClass);
?>
--EXPECTF--
Fatal error: Uncaught Error: Call to undefined function testConversion() in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d