From: Marcus Boerger Date: Sun, 13 Jul 2008 21:37:04 +0000 (+0000) Subject: - Fix old workaround, since we are not C++ we can deal with exceptions in X-Git-Tag: BEFORE_HEAD_NS_CHANGE~1283 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0960a894f86491c9ebd5f711e818b102c7bfa367;p=php - Fix old workaround, since we are not C++ we can deal with exceptions in dtors (whether or not an exception is already pending). --- diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c index 0b2b97dbcd..950adcb2f1 100644 --- a/Zend/zend_objects.c +++ b/Zend/zend_objects.c @@ -100,20 +100,7 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl old_exception = EG(exception); EG(exception) = NULL; zend_call_method_with_0_params(&obj, object->ce, &destructor, ZEND_DESTRUCTOR_FUNC_NAME, NULL); - if (old_exception) { - if (EG(exception)) { - zend_class_entry *default_exception_ce = zend_exception_get_default(TSRMLS_C); - zval *file = zend_read_property(default_exception_ce, old_exception, "file", sizeof("file")-1, 1 TSRMLS_CC); - zval *line = zend_read_property(default_exception_ce, old_exception, "line", sizeof("line")-1, 1 TSRMLS_CC); - - zval_ptr_dtor(&obj); - zval_ptr_dtor(&EG(exception)); - EG(exception) = old_exception; - zend_error(E_ERROR, "Ignoring exception from %v::__destruct() while an exception is already active (Uncaught %v in %R on line %ld)", - object->ce->name, Z_OBJCE_P(old_exception)->name, Z_TYPE_P(file), Z_UNIVAL_P(file), Z_LVAL_P(line)); - } - EG(exception) = old_exception; - } + zend_exception_set_previous(old_exception TSRMLS_CC); zval_ptr_dtor(&obj); } }