summaryrefslogtreecommitdiff
path: root/Zend/zend_exceptions.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-10-10 14:14:36 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-10-11 12:41:15 +0200
commitdb233501ff9d56765ef4a870b777a643c2136711 (patch)
treedee39ce888124d9c70bff6e59ae62c580a983b37 /Zend/zend_exceptions.c
parentaab1445b4c30e81b0725470b2fc3e8112449eb5f (diff)
downloadphp-git-db233501ff9d56765ef4a870b777a643c2136711.tar.gz
Use clean shutdown on uncaught exception
Diffstat (limited to 'Zend/zend_exceptions.c')
-rw-r--r--Zend/zend_exceptions.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index 9fd0176c34..6dfb374c2c 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -157,8 +157,9 @@ ZEND_API ZEND_COLD void zend_throw_exception_internal(zval *exception) /* {{{ */
if (exception && (Z_OBJCE_P(exception) == zend_ce_parse_error || Z_OBJCE_P(exception) == zend_ce_compile_error)) {
return;
}
- if(EG(exception)) {
+ if (EG(exception)) {
zend_exception_error(EG(exception), E_ERROR);
+ zend_bailout();
}
zend_error_noreturn(E_CORE_ERROR, "Exception thrown without a stack frame");
}
@@ -991,7 +992,8 @@ ZEND_API ZEND_COLD void zend_exception_error(zend_object *ex, int severity) /* {
zend_string *file = zval_get_string(GET_PROPERTY_SILENT(&exception, ZEND_STR_FILE));
zend_long line = zval_get_long(GET_PROPERTY_SILENT(&exception, ZEND_STR_LINE));
- zend_error_helper(ce_exception == zend_ce_parse_error ? E_PARSE : E_COMPILE_ERROR,
+ zend_error_helper(
+ (ce_exception == zend_ce_parse_error ? E_PARSE : E_COMPILE_ERROR) | E_DONT_BAIL,
ZSTR_VAL(file), line, "%s", ZSTR_VAL(message));
zend_string_release_ex(file, 0);
@@ -1034,7 +1036,8 @@ ZEND_API ZEND_COLD void zend_exception_error(zend_object *ex, int severity) /* {
file = zval_get_string(GET_PROPERTY_SILENT(&exception, ZEND_STR_FILE));
line = zval_get_long(GET_PROPERTY_SILENT(&exception, ZEND_STR_LINE));
- zend_error_va(severity, (file && ZSTR_LEN(file) > 0) ? ZSTR_VAL(file) : NULL, line,
+ zend_error_va(severity | E_DONT_BAIL,
+ (file && ZSTR_LEN(file) > 0) ? ZSTR_VAL(file) : NULL, line,
"Uncaught %s\n thrown", ZSTR_VAL(str));
zend_string_release_ex(str, 0);