From c57dd7c6efb98c89a8c87af0eaad76b71c9cda16 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 6 Jul 2017 16:33:46 +0300 Subject: [PATCH] Use reference-counting --- ext/opcache/Optimizer/sccp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/opcache/Optimizer/sccp.c b/ext/opcache/Optimizer/sccp.c index 6ff491c3a60..c795ec2e67f 100644 --- a/ext/opcache/Optimizer/sccp.c +++ b/ext/opcache/Optimizer/sccp.c @@ -355,11 +355,10 @@ static inline int ct_eval_isset_dim(zval *result, uint32_t extended_value, zval } } -// TODO Avoid the copy_ctor static inline int ct_eval_add_array_elem(zval *result, zval *value, zval *key) { if (!key) { if ((value = zend_hash_next_index_insert(Z_ARR_P(result), value))) { - zval_copy_ctor(value); + Z_TRY_ADDREF_P(value); return SUCCESS; } return FAILURE; @@ -389,7 +388,7 @@ static inline int ct_eval_add_array_elem(zval *result, zval *value, zval *key) { return FAILURE; } - zval_copy_ctor(value); + Z_TRY_ADDREF_P(value); return SUCCESS; }