summaryrefslogtreecommitdiff
path: root/Zend/zend_builtin_functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r--Zend/zend_builtin_functions.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 6e97b100ae..27559f59f4 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -395,18 +395,18 @@ ZEND_FUNCTION(each)
entry = *entry_ptr;
/* add value elements */
- if (entry->is_ref) {
+ if (Z_ISREF_P(entry)) {
ALLOC_ZVAL(tmp);
*tmp = *entry;
zval_copy_ctor(tmp);
- tmp->is_ref=0;
- tmp->refcount=0;
+ Z_UNSET_ISREF_P(tmp);
+ Z_SET_REFCOUNT_P(tmp, 0);
entry=tmp;
}
zend_hash_index_update(return_value->value.ht, 1, &entry, sizeof(zval *), NULL);
- entry->refcount++;
+ Z_ADDREF_P(entry);
zend_hash_update(return_value->value.ht, "value", sizeof("value"), &entry, sizeof(zval *), NULL);
- entry->refcount++;
+ Z_ADDREF_P(entry);
/* add the key elements */
switch (zend_hash_get_current_key_ex(target_hash, &string_key, &string_key_len, &num_key, 1, NULL)) {
@@ -418,7 +418,7 @@ ZEND_FUNCTION(each)
break;
}
zend_hash_update(return_value->value.ht, "key", sizeof("key"), inserted_pointer, sizeof(zval *), NULL);
- (*inserted_pointer)->refcount++;
+ Z_ADDREF_PP(inserted_pointer);
zend_hash_move_forward(target_hash);
}
/* }}} */
@@ -841,7 +841,7 @@ ZEND_FUNCTION(get_object_vars)
if (zend_check_property_access(zobj, key, key_len-1 TSRMLS_CC) == SUCCESS) {
zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name);
/* Not separating references */
- (*value)->refcount++;
+ Z_ADDREF_PP(value);
add_assoc_zval_ex(return_value, prop_name, strlen(prop_name)+1, *value);
}
}
@@ -1700,7 +1700,7 @@ static zval *debug_backtrace_get_args(void ***curpos TSRMLS_DC)
if (Z_TYPE_PP(arg) != IS_OBJECT) {
SEPARATE_ZVAL_TO_MAKE_IS_REF(arg);
}
- (*arg)->refcount++;
+ Z_ADDREF_PP(arg);
add_next_index_zval(arg_array, *arg);
} else {
add_next_index_null(arg_array);
@@ -2038,7 +2038,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
}
if (provide_object) {
add_assoc_zval_ex(stack_frame, "object", sizeof("object"), ptr->object);
- ptr->object->refcount++;
+ Z_ADDREF_P(ptr->object);
}
add_assoc_string_ex(stack_frame, "type", sizeof("type"), "->", 1);