Skip to content

Commit c57dd7c

Browse files
committed
Use reference-counting
1 parent 90f822d commit c57dd7c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ext/opcache/Optimizer/sccp.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,10 @@ static inline int ct_eval_isset_dim(zval *result, uint32_t extended_value, zval
355355
}
356356
}
357357

358-
// TODO Avoid the copy_ctor
359358
static inline int ct_eval_add_array_elem(zval *result, zval *value, zval *key) {
360359
if (!key) {
361360
if ((value = zend_hash_next_index_insert(Z_ARR_P(result), value))) {
362-
zval_copy_ctor(value);
361+
Z_TRY_ADDREF_P(value);
363362
return SUCCESS;
364363
}
365364
return FAILURE;
@@ -389,7 +388,7 @@ static inline int ct_eval_add_array_elem(zval *result, zval *value, zval *key) {
389388
return FAILURE;
390389
}
391390

392-
zval_copy_ctor(value);
391+
Z_TRY_ADDREF_P(value);
393392
return SUCCESS;
394393
}
395394

0 commit comments

Comments
 (0)