From: Xinchen Hui Date: Sun, 2 Mar 2014 07:15:51 +0000 (+0800) Subject: Fixed refcounting X-Git-Tag: POST_PHPNG_MERGE~412^2~465 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8d2c1f58a16c4343204cc828bae6291c1064d565;p=php Fixed refcounting --- diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 45a719e64b..d2583621e3 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -5038,7 +5038,9 @@ ZEND_METHOD(reflection_property, setValue) ZVAL_COPY_VALUE(&garbage, variable_ptr); /* if we assign referenced variable, we should separate it */ - Z_ADDREF_P(value); + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } if (Z_ISREF_P(value)) { SEPARATE_ZVAL(value); }