summaryrefslogtreecommitdiff
path: root/Zend/zend_execute_API.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-03-06 14:57:55 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-06-29 15:50:12 +0200
commit75a04eac978333467ccd98225d7ef21942ce9e91 (patch)
treeff3ea4cc064bacba90ec19a4d056de348b6d749b /Zend/zend_execute_API.c
parentd005a8e92becb9993ab0d370e4f5688d09bcaaf2 (diff)
downloadphp-git-75a04eac978333467ccd98225d7ef21942ce9e91.tar.gz
Make exit() unwind properly
exit() is now internally implemented by throwing an exception, performing a normal stack unwind and a clean shutdown. This ensures that no persistent resource leaks occur. The exception is internal, cannot be caught and does not result in the execution of finally blocks. This may be relaxed in the future. Closes GH-5768.
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r--Zend/zend_execute_API.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index f1babc3d02..d62f104f22 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -1141,8 +1141,7 @@ ZEND_API int zend_eval_stringl_ex(const char *str, size_t str_len, zval *retval_
result = zend_eval_stringl(str, str_len, retval_ptr, string_name);
if (handle_exceptions && EG(exception)) {
- zend_exception_error(EG(exception), E_ERROR);
- result = FAILURE;
+ result = zend_exception_error(EG(exception), E_ERROR);
}
return result;
}