summaryrefslogtreecommitdiff
path: root/Zend/zend_exceptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_exceptions.c')
-rw-r--r--Zend/zend_exceptions.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index fda4d21e03..95d18f45fb 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -893,11 +893,10 @@ static void zend_error_va(int type, const char *file, uint lineno, const char *f
ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {{{ */
{
zend_class_entry *ce_exception = Z_OBJCE_P(exception);
+ EG(exception) = NULL;
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
zval *str, *file, *line;
- EG(exception) = NULL;
-
zend_call_method_with_0_params(&exception, ce_exception, NULL, "__tostring", &str);
if (!EG(exception)) {
if (Z_TYPE_P(str) != IS_STRING) {
@@ -936,6 +935,7 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
} else {
zend_error(severity, "Uncaught exception '%s'", ce_exception->name);
}
+ zval_ptr_dtor(&exception);
}
/* }}} */