1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 18:23:26 +02:00

Fix exceptions thrown without a stack frame

Always enable set_exception_handler()
This commit is contained in:
Zeev Suraski
2004-02-11 12:31:18 +00:00
parent 6e4a4e8a9a
commit 6b6fe2f76e
2 changed files with 4 additions and 6 deletions
-6
View File
@@ -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;
+4
View File
@@ -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;