From: Dmitry Stogov Date: Tue, 2 Jun 2015 09:03:34 +0000 (+0300) Subject: Call zend_array_dup() instead of zval_copy_ctor(). X-Git-Tag: php-7.0.0alpha1~49 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a089e7e71bfcb0829e97feb42a7495f8e39e1b4;p=php Call zend_array_dup() instead of zval_copy_ctor(). --- diff --git a/Zend/zend_types.h b/Zend/zend_types.h index c1fceab07d..63565182ce 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -890,11 +890,12 @@ static zend_always_inline uint32_t zval_delref_p(zval* pz) { #define SEPARATE_ARRAY(zv) do { \ zval *_zv = (zv); \ - if (Z_REFCOUNT_P(_zv) > 1) { \ + zend_array *_arr = Z_ARR_P(_zv); \ + if (GC_REFCOUNT(_arr) > 1) { \ if (!Z_IMMUTABLE_P(_zv)) { \ - Z_DELREF_P(_zv); \ + GC_REFCOUNT(_arr)--; \ } \ - zval_copy_ctor_func(_zv); \ + ZVAL_ARR(_zv, zend_array_dup(_arr)); \ } \ } while (0)