summaryrefslogtreecommitdiff
path: root/Zend/zend_exceptions.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2016-10-22 14:50:21 +0800
committerXinchen Hui <laruence@gmail.com>2016-10-22 14:50:21 +0800
commiteca84946a4e7269d59ea2d79b5f42117de89ae74 (patch)
tree41608e9c78ac5f272a5808affd9853d156f9649a /Zend/zend_exceptions.c
parent55d17662cb61bc29f443276b0cd50b3a62f91acc (diff)
downloadphp-git-eca84946a4e7269d59ea2d79b5f42117de89ae74.tar.gz
Fixed bug #73350 (Exception::__toString() cause circular references)
Diffstat (limited to 'Zend/zend_exceptions.c')
-rw-r--r--Zend/zend_exceptions.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index 89c94eb56f..e0aa370bfe 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -776,14 +776,15 @@ ZEND_METHOD(exception, __toString)
Z_OBJPROP_P(exception)->u.v.nApplyCount++;
exception = GET_PROPERTY(exception, "previous");
if (exception && Z_TYPE_P(exception) == IS_OBJECT && Z_OBJPROP_P(exception)->u.v.nApplyCount > 0) {
- exception = NULL;
+ break;
}
}
zval_dtor(&fname);
+ exception = getThis();
/* Reset apply counts */
while (exception && Z_TYPE_P(exception) == IS_OBJECT && (base_ce = i_get_exception_base(exception)) && instanceof_function(Z_OBJCE_P(exception), base_ce)) {
- if(Z_OBJPROP_P(exception)->u.v.nApplyCount) {
+ if (Z_OBJPROP_P(exception)->u.v.nApplyCount) {
Z_OBJPROP_P(exception)->u.v.nApplyCount--;
} else {
break;