From 75a04eac978333467ccd98225d7ef21942ce9e91 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 6 Mar 2020 14:57:55 +0100 Subject: 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. --- Zend/zend_exceptions.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Zend/zend_exceptions.h') 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" -- cgit v1.2.1