From: Stig Bakken Date: Tue, 5 Nov 2002 06:10:05 +0000 (+0000) Subject: Fixed some special cases that were crashing for the exception default X-Git-Tag: php-4.3.0RC1~282 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b899f9bf63acfbd3cc65551a97d041f09d4f4d8c;p=php Fixed some special cases that were crashing for the exception default handler. --- diff --git a/Zend/zend.c b/Zend/zend.c index fb5646a661..3901a46457 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -870,7 +870,13 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co params[0] = &EG(exception); orig_user_exception_handler = EG(user_exception_handler); if (call_user_function_ex(CG(function_table), NULL, orig_user_exception_handler, &retval2, 1, params, 1, NULL TSRMLS_CC) == SUCCESS) { - zval_ptr_dtor(&retval2); + if (retval2 != NULL) { + zval_ptr_dtor(&retval2); + } + } else { + zval_ptr_dtor(&EG(exception)); + EG(exception) = NULL; + zend_error(E_ERROR, "Uncaught exception!"); } efree(params); zval_ptr_dtor(&EG(exception)); @@ -880,7 +886,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co EG(exception) = NULL; zend_error(E_ERROR, "Uncaught exception!"); } - if (!retval) { + if (retval == NULL && *EG(return_value_ptr_ptr) != NULL) { zval_ptr_dtor(EG(return_value_ptr_ptr)); local_retval = NULL; }