mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix incorrect handling of unwind and graceful exit exceptions
These exceptions should not invoke the user error handler, and not cause bailing of the request. Fixes GH-11601 Closes GH-11608
This commit is contained in:
parent
cf587c1a1b
commit
11aee73572
3 changed files with 10 additions and 6 deletions
2
NEWS
2
NEWS
|
@ -9,6 +9,8 @@ PHP NEWS
|
||||||
- Core:
|
- Core:
|
||||||
. Fixed line number of JMP instruction over else block. (ilutov)
|
. Fixed line number of JMP instruction over else block. (ilutov)
|
||||||
. Fixed use-of-uninitialized-value with ??= on assert. (ilutov)
|
. Fixed use-of-uninitialized-value with ??= on assert. (ilutov)
|
||||||
|
. Fixed bug GH-11601 (Incorrect handling of unwind and graceful exit
|
||||||
|
exceptions). (ilutov)
|
||||||
|
|
||||||
- OpenSSL
|
- OpenSSL
|
||||||
. Added support for additional EC parameters in openssl_pkey_new. (Eno-CN)
|
. Added support for additional EC parameters in openssl_pkey_new. (Eno-CN)
|
||||||
|
|
|
@ -199,8 +199,14 @@ ZEND_API ZEND_COLD void zend_throw_exception_internal(zend_object *exception) /*
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (EG(exception)) {
|
if (EG(exception)) {
|
||||||
if (Z_TYPE(EG(user_exception_handler)) != IS_UNDEF) {
|
if (Z_TYPE(EG(user_exception_handler)) != IS_UNDEF
|
||||||
|
&& !zend_is_unwind_exit(EG(exception))
|
||||||
|
&& !zend_is_graceful_exit(EG(exception))) {
|
||||||
zend_user_exception_handler();
|
zend_user_exception_handler();
|
||||||
|
if (EG(exception)) {
|
||||||
|
zend_exception_error(EG(exception), E_ERROR);
|
||||||
|
}
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
zend_exception_error(EG(exception), E_ERROR);
|
zend_exception_error(EG(exception), E_ERROR);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1010,11 +1010,7 @@ cleanup_args:
|
||||||
|
|
||||||
if (UNEXPECTED(EG(exception))) {
|
if (UNEXPECTED(EG(exception))) {
|
||||||
if (UNEXPECTED(!EG(current_execute_data))) {
|
if (UNEXPECTED(!EG(current_execute_data))) {
|
||||||
if (Z_TYPE(EG(user_exception_handler)) != IS_UNDEF) {
|
|
||||||
zend_user_exception_handler();
|
|
||||||
} else {
|
|
||||||
zend_throw_exception_internal(NULL);
|
zend_throw_exception_internal(NULL);
|
||||||
}
|
|
||||||
} else if (EG(current_execute_data)->func &&
|
} else if (EG(current_execute_data)->func &&
|
||||||
ZEND_USER_CODE(EG(current_execute_data)->func->common.type)) {
|
ZEND_USER_CODE(EG(current_execute_data)->func->common.type)) {
|
||||||
zend_rethrow_exception(EG(current_execute_data));
|
zend_rethrow_exception(EG(current_execute_data));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue