From 8a089e7e71bfcb0829e97feb42a7495f8e39e1b4 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 2 Jun 2015 12:03:34 +0300 Subject: [PATCH] Call zend_array_dup() instead of zval_copy_ctor(). --- Zend/zend_types.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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) -- 2.50.1