diff options
| author | Nikita Popov <nikic@php.net> | 2015-01-05 17:02:11 +0100 |
|---|---|---|
| committer | Nikita Popov <nikic@php.net> | 2015-01-05 17:02:11 +0100 |
| commit | 1266515e19cb30dab5c63df764d18233a234aba6 (patch) | |
| tree | bb8e7ddbb307ac184350736020d4f17ddc062845 /ext/spl/spl_array.c | |
| parent | 411980a8bcb713694efa7656b423f8e6b2b6de48 (diff) | |
| download | php-git-1266515e19cb30dab5c63df764d18233a234aba6.tar.gz | |
Fix uses of zval_add_ref and add comment on usage
zval_add_ref should be used as a copy ctor, after the value was
already copied.
In particular when used with hash insertions, it should be applied
to the return value of the insert function.
Diffstat (limited to 'ext/spl/spl_array.c')
| -rw-r--r-- | ext/spl/spl_array.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 69d59dc118..7a7ce2c22c 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -869,7 +869,7 @@ static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp) /* {{{ */ zend_hash_copy(intern->debug_info, intern->std.properties, (copy_ctor_func_t) zval_add_ref); storage = &intern->array; - zval_add_ref(storage); + Z_TRY_ADDREF_P(storage); base = (Z_OBJ_HT_P(obj) == &spl_handler_ArrayIterator) ? spl_ce_ArrayIterator : spl_ce_ArrayObject; zname = spl_gen_private_prop_name(base, "storage", sizeof("storage")-1); |
