summaryrefslogtreecommitdiff
path: root/Zend/zend.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2005-07-22 07:33:03 +0000
committerDmitry Stogov <dmitry@php.net>2005-07-22 07:33:03 +0000
commit1c82ec11a1ce04a9e4999a33f35d527d4e38306a (patch)
tree20861dcfcb2fdc1fff3e167afbc294a57f9a2838 /Zend/zend.c
parentb19c520142c27815aa304c57f4353634669a7ea5 (diff)
downloadphp-git-1c82ec11a1ce04a9e4999a33f35d527d4e38306a.tar.gz
Fixed bug #33802 (throw Exception in error handler causes crash)
Diffstat (limited to 'Zend/zend.c')
-rw-r--r--Zend/zend.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index ba84e39a5f..eb79640b28 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -975,8 +975,7 @@ ZEND_API void zend_error(int type, const char *format, ...)
z_context->value.ht = EG(active_symbol_table);
z_context->type = IS_ARRAY;
- ZVAL_ADDREF(z_context); /* we don't want this one to be freed */
- z_context->is_ref = 1;
+ zval_copy_ctor(z_context);
params = (zval ***) emalloc(sizeof(zval **)*5);
params[0] = &z_error_type;
@@ -989,9 +988,6 @@ ZEND_API void zend_error(int type, const char *format, ...)
EG(user_error_handler) = NULL;
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC)==SUCCESS) {
- if (Z_TYPE_P(z_context) != IS_ARRAY || z_context->value.ht != EG(active_symbol_table)) {
- zend_error(E_ERROR, "User error handler must not modify error context");
- }
if (retval) {
if (Z_TYPE_P(retval) == IS_BOOL && Z_LVAL_P(retval) == 0) {
zend_error_cb(type, error_filename, error_lineno, format, args);
@@ -1015,12 +1011,7 @@ ZEND_API void zend_error(int type, const char *format, ...)
zval_ptr_dtor(&z_error_type);
zval_ptr_dtor(&z_error_filename);
zval_ptr_dtor(&z_error_lineno);
- if (ZVAL_REFCOUNT(z_context) <= 2) {
- FREE_ZVAL(z_context);
- } else {
- ZVAL_DELREF(z_context);
- zval_ptr_dtor(&z_context);
- }
+ zval_ptr_dtor(&z_context);
break;
}