Merge branch 'PHP-8.4'

* PHP-8.4:
  Fix segfault on debug_backtrace() in _ZendTestFiber
This commit is contained in:
Ilija Tovilo 2024-10-14 14:05:26 +02:00
commit b55b957adf
No known key found for this signature in database
GPG key ID: 5050C66BFCD1015A
2 changed files with 23 additions and 0 deletions

View file

@ -91,6 +91,7 @@ static ZEND_STACK_ALIGNED void zend_test_fiber_execute(zend_fiber_transfer *tran
execute_data = (zend_execute_data *) stack->top; execute_data = (zend_execute_data *) stack->top;
memset(execute_data, 0, sizeof(zend_execute_data)); memset(execute_data, 0, sizeof(zend_execute_data));
execute_data->func = (zend_function *) &zend_pass_function;
EG(current_execute_data) = execute_data; EG(current_execute_data) = execute_data;
EG(jit_trace_num) = 0; EG(jit_trace_num) = 0;

View file

@ -0,0 +1,22 @@
--TEST--
GH-16230: Segfault on debug_backtrace() inside _ZendTestFiber
--EXTENSIONS--
zend_test
--FILE--
<?php
$test = new _ZendTestFiber(function (): void {
var_dump(debug_backtrace());
});
$test->start();
?>
--EXPECT--
array(1) {
[0]=>
array(2) {
["function"]=>
string(9) "{closure}"
["args"]=>
array(0) {
}
}
}