From: Dmitry Stogov Date: Fri, 21 Mar 2014 07:33:20 +0000 (+0400) Subject: Fixed refcounting X-Git-Tag: POST_PHPNG_MERGE~412^2~249 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2f4e8aa5d76816952205ecf3469794b6f0086976;p=php Fixed refcounting --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 25ac33920d..ecbe67ab99 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1266,24 +1266,14 @@ convert_to_array: if (!Z_ISREF_P(overloaded_result)) { if (Z_REFCOUNTED_P(overloaded_result) && Z_REFCOUNT_P(overloaded_result) > 1) { -//??? -#if 1 -// if (Z_TYPE_P(overloaded_result) != IS_OBJECT) { + if (Z_TYPE_P(overloaded_result) != IS_OBJECT) { Z_DELREF_P(overloaded_result); ZVAL_DUP(result, overloaded_result); overloaded_result = result; -// } else { - ZVAL_COPY_VALUE(result, overloaded_result); + } else { + ZVAL_COPY(result, overloaded_result); overloaded_result = result; -// } -#else -//??? zval *tmp = overloaded_result; -//??? -//??? ALLOC_ZVAL(overloaded_result); -//??? ZVAL_DUP(overloaded_result, tmp); -//??? Z_UNSET_ISREF_P(overloaded_result); -//??? Z_SET_REFCOUNT_P(overloaded_result, 0); -#endif + } } if (Z_TYPE_P(overloaded_result) != IS_OBJECT) { zend_class_entry *ce = Z_OBJCE_P(container);