summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Bakken <ssb@php.net>2002-11-05 06:10:05 +0000
committerStig Bakken <ssb@php.net>2002-11-05 06:10:05 +0000
commitb899f9bf63acfbd3cc65551a97d041f09d4f4d8c (patch)
treed0dd3609e505d0799131dbe920c1dc9c9d822b79
parentefeaa5917ccba60850a21322846c8f72bc619c71 (diff)
downloadphp-git-b899f9bf63acfbd3cc65551a97d041f09d4f4d8c.tar.gz
Fixed some special cases that were crashing for the exception default
handler.
-rw-r--r--Zend/zend.c10
1 files changed, 8 insertions, 2 deletions
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;
}