From: Xinchen Hui Date: Sat, 22 Oct 2016 06:50:42 +0000 (+0800) Subject: Merge branch 'PHP-7.0' into PHP-7.1 X-Git-Tag: php-7.1.0RC5~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=788368ff1cb7f933076b6eef6210a3c54eddc5dc;p=php Merge branch 'PHP-7.0' into PHP-7.1 * PHP-7.0: Fixed bug #73350 (Exception::__toString() cause circular references) --- 788368ff1cb7f933076b6eef6210a3c54eddc5dc diff --cc Zend/zend_exceptions.c index 331213d8e6,e0aa370bfe..8f41e1ce71 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@@ -738,16 -774,17 +738,17 @@@ ZEND_METHOD(exception, __toString zval_ptr_dtor(&trace); Z_OBJPROP_P(exception)->u.v.nApplyCount++; - exception = GET_PROPERTY(exception, "previous"); + 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; } } - zval_dtor(&fname); + 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;