From: Zeev Suraski Date: Wed, 1 Dec 1999 22:00:58 +0000 (+0000) Subject: Make it possible to explicitly set refcount in ZEND_SET_SYMBOL_WITH_LENGTH(), part 2 X-Git-Tag: PRE_RETURN_REF_PATCH~137 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ddc4fe4f54ac9ab15c3cf5cf75c0ab684666c91;p=php Make it possible to explicitly set refcount in ZEND_SET_SYMBOL_WITH_LENGTH(), part 2 --- diff --git a/Zend/zend_API.h b/Zend/zend_API.h index b54942df0a..4434e2cb87 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -256,6 +256,9 @@ ZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length, (var)->refcount = (*orig_var)->refcount; \ (var)->is_ref = 1; \ \ + if (_refcount) { \ + (var)->refcount += _refcount-1; \ + } \ zval_dtor(*orig_var); \ **orig_var = *(var); \ efree(var); \