]> granicus.if.org Git - php/commitdiff
Fixed some special cases that were crashing for the exception default
authorStig Bakken <ssb@php.net>
Tue, 5 Nov 2002 06:10:05 +0000 (06:10 +0000)
committerStig Bakken <ssb@php.net>
Tue, 5 Nov 2002 06:10:05 +0000 (06:10 +0000)
handler.

Zend/zend.c

index fb5646a661bd84ce9c17530ff99121d65f8de25e..3901a464579380adb36a10f30f135b0226d28703 100644 (file)
@@ -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;
                                }