diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-03-06 14:57:55 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-06-29 15:50:12 +0200 |
commit | 75a04eac978333467ccd98225d7ef21942ce9e91 (patch) | |
tree | ff3ea4cc064bacba90ec19a4d056de348b6d749b /Zend/zend_exceptions.h | |
parent | d005a8e92becb9993ab0d370e4f5688d09bcaaf2 (diff) | |
download | php-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_exceptions.h')
-rw-r--r-- | Zend/zend_exceptions.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Zend/zend_exceptions.h b/Zend/zend_exceptions.h index ced74bf9f1..fdae31a013 100644 --- a/Zend/zend_exceptions.h +++ b/Zend/zend_exceptions.h @@ -66,7 +66,10 @@ ZEND_API zend_object *zend_throw_error_exception(zend_class_entry *exception_ce, extern ZEND_API void (*zend_throw_exception_hook)(zval *ex); /* show an exception using zend_error(severity,...), severity should be E_ERROR */ -ZEND_API ZEND_COLD void zend_exception_error(zend_object *exception, int severity); +ZEND_API ZEND_COLD int zend_exception_error(zend_object *exception, int severity); + +ZEND_API ZEND_COLD void zend_throw_unwind_exit(void); +ZEND_API zend_bool zend_is_unwind_exit(zend_object *ex); #include "zend_globals.h" |