diff options
| author | Dmitry Stogov <dmitry@zend.com> | 2017-10-06 01:34:50 +0300 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@zend.com> | 2017-10-06 01:34:50 +0300 |
| commit | cb9d81ef4f07f82835273800b0cb3d6a67816050 (patch) | |
| tree | dad640422674e3eb45a2577f5b29fcd7ad9c8676 /Zend/zend_exceptions.c | |
| parent | 39ea632f7468e1001b15b9c43afc6aba9debdc9c (diff) | |
| download | php-git-cb9d81ef4f07f82835273800b0cb3d6a67816050.tar.gz | |
Refactored recursion pretection
Diffstat (limited to 'Zend/zend_exceptions.c')
| -rw-r--r-- | Zend/zend_exceptions.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 4bf2b746cb..d9ea885a62 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -711,9 +711,9 @@ ZEND_METHOD(exception, __toString) zend_string_release(file); zval_ptr_dtor(&trace); - Z_OBJPROP_P(exception)->u.v.nApplyCount++; + Z_PROTECT_RECURSION_P(exception); exception = GET_PROPERTY(exception, ZEND_STR_PREVIOUS); - if (exception && Z_TYPE_P(exception) == IS_OBJECT && Z_OBJPROP_P(exception)->u.v.nApplyCount > 0) { + if (exception && Z_TYPE_P(exception) == IS_OBJECT && Z_IS_RECURSIVE_P(exception)) { break; } } @@ -722,8 +722,8 @@ ZEND_METHOD(exception, __toString) 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) { - Z_OBJPROP_P(exception)->u.v.nApplyCount--; + if (Z_IS_RECURSIVE_P(exception)) { + Z_UNPROTECT_RECURSION_P(exception); } else { break; } |
