mirror of
https://github.com/php/php-src.git
synced 2024-12-15 04:45:03 +08:00
Merge branch 'PHP-8.2'
* PHP-8.2: [ci skip] NEWS Fix GH-10437: Set active fiber to null on bailout (#10443)
This commit is contained in:
commit
ff84598055
18
Zend/tests/fibers/gh10437.phpt
Normal file
18
Zend/tests/fibers/gh10437.phpt
Normal file
@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
GH-10437 (Segfault/assertion when using fibers in shutdown function after bailout)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
register_shutdown_function(function (): void {
|
||||
var_dump(Fiber::getCurrent());
|
||||
});
|
||||
|
||||
$fiber = new Fiber(function (): never {
|
||||
trigger_error('Bailout in fiber', E_USER_ERROR);
|
||||
});
|
||||
$fiber->start();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Bailout in fiber in %sgh10437.php on line %d
|
||||
NULL
|
@ -645,6 +645,7 @@ static zend_always_inline zend_fiber_transfer zend_fiber_switch_to(
|
||||
|
||||
/* Forward bailout into current fiber. */
|
||||
if (UNEXPECTED(transfer.flags & ZEND_FIBER_TRANSFER_FLAG_BAILOUT)) {
|
||||
EG(active_fiber) = NULL;
|
||||
zend_bailout();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user