mirror of
https://github.com/php/php-src.git
synced 2024-11-27 03:44:07 +08:00
Don't overwrite unwind exception
When killing a coroutine by throwing an unwind exit into it during an I/O operation, the I/O failure may result in an exception being thrown, which will replace the unwind exit exception and the coroutine will ultimately not exit. This patch avoids this by ignoring the newly thrown exception and keeping the unwind exit exception. Closes GH-7459.
This commit is contained in:
parent
c87f405084
commit
85b80c5aaf
@ -165,6 +165,12 @@ ZEND_API ZEND_COLD void zend_throw_exception_internal(zend_object *exception) /*
|
||||
|
||||
if (exception != NULL) {
|
||||
zend_object *previous = EG(exception);
|
||||
if (previous && zend_is_unwind_exit(previous)) {
|
||||
/* Don't replace unwinding exception with different exception. */
|
||||
OBJ_RELEASE(exception);
|
||||
return;
|
||||
}
|
||||
|
||||
zend_exception_set_previous(exception, EG(exception));
|
||||
EG(exception) = exception;
|
||||
if (previous) {
|
||||
|
Loading…
Reference in New Issue
Block a user