diff options
-rw-r--r-- | Zend/zend.c | 6 | ||||
-rw-r--r-- | Zend/zend_execute_API.c | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/Zend/zend.c b/Zend/zend.c index 9d4bcc283b..d7c34069f5 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1057,7 +1057,6 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co } else { strcpy(ex_class_name, "Unknown Exception"); } -#if 1 /* support set_exception_handler() */ if (EG(user_exception_handler)) { zval *orig_user_exception_handler; zval ***params, *retval2, *old_exception; @@ -1090,11 +1089,6 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co zval_ptr_dtor(EG(return_value_ptr_ptr)); local_retval = NULL; } -#else - zend_exception_error(EG(exception) TSRMLS_CC); - zval_ptr_dtor(&EG(exception)); - EG(exception) = NULL; -#endif } else if (!retval) { zval_ptr_dtor(EG(return_value_ptr_ptr)); local_retval = NULL; diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index dc1a90313c..3ace0a2565 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1200,6 +1200,10 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) } EG(exception) = exception; } + if (!EG(current_execute_data)) { + zend_error(E_ERROR, "Exception thrown without a stack frame"); + } + if ((EG(current_execute_data)->opline+1)->opcode == ZEND_HANDLE_EXCEPTION) { /* no need to rethrow the exception */ return; |