summaryrefslogtreecommitdiff
path: root/Zend/zend_exceptions.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2016-10-22 14:50:42 +0800
committerXinchen Hui <laruence@gmail.com>2016-10-22 14:50:42 +0800
commit788368ff1cb7f933076b6eef6210a3c54eddc5dc (patch)
tree211e756a58d63e08987b771ff1d5c87b127e9d81 /Zend/zend_exceptions.c
parent2860fd40d6af162b302eec73d462db6ff5113a6a (diff)
parenteca84946a4e7269d59ea2d79b5f42117de89ae74 (diff)
downloadphp-git-788368ff1cb7f933076b6eef6210a3c54eddc5dc.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: 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 331213d8e6..8f41e1ce71 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -740,14 +740,15 @@ ZEND_METHOD(exception, __toString)
Z_OBJPROP_P(exception)->u.v.nApplyCount++;
exception = GET_PROPERTY(exception, ZEND_STR_PREVIOUS);
if (exception && Z_TYPE_P(exception) == IS_OBJECT && Z_OBJPROP_P(exception)->u.v.nApplyCount > 0) {
- exception = NULL;
+ break;
}
}
zend_string_release(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;