cvs: ZendEngine2 / zend.c
| From: | Stanislav Malyshev | Date: | Sun, 15 Jun 2003 15:07:55 +0000 |
| Subject: | cvs: ZendEngine2 / zend.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1373@lists.php.net to get a copy of this message | ||
stas Sun Jun 15 11:07:55 2003 EDT
Modified files:
/ZendEngine2 zend.c
Log:
Fix bug #23279 - exception handler exits after first function call
Index: ZendEngine2/zend.c
diff -u ZendEngine2/zend.c:1.238 ZendEngine2/zend.c:1.239
--- ZendEngine2/zend.c:1.238 Sat Jun 14 05:25:36 2003
+++ ZendEngine2/zend.c Sun Jun 15 11:07:55 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend.c,v 1.238 2003/06/14 09:25:36 helly Exp $ */
+/* $Id: zend.c,v 1.239 2003/06/15 15:07:55 stas Exp $ */
#include "zend.h"
#include "zend_extensions.h"
@@ -1026,9 +1026,11 @@
#if 1 /* support set_exception_handler() */
if (EG(user_exception_handler)) {
zval *orig_user_exception_handler;
- zval ***params, *retval2;
+ zval ***params, *retval2, *old_exception;
params = (zval ***)emalloc(sizeof(zval **));
- params[0] = &EG(exception);
+ old_exception = EG(exception);
+ EG(exception) = NULL;
+ params[0] = &old_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) {
if (retval2 != NULL) {
@@ -1040,8 +1042,11 @@
zend_error(E_ERROR, "Uncaught exception '%s'!", ex_class_name);
}
efree(params);
- zval_ptr_dtor(&EG(exception));
- EG(exception) = NULL;
+ zval_ptr_dtor(&old_exception);
+ if(EG(exception)) {
+ zval_ptr_dtor(&EG(exception));
+ EG(exception) = NULL;
+ }
} else {
zval_ptr_dtor(&EG(exception));
EG(exception) = NULL;