diff options
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/reflection/php_reflection.c | 2 | ||||
| -rw-r--r-- | ext/standard/array.c | 4 | ||||
| -rw-r--r-- | ext/standard/basic_functions.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index c236f0d765..20d644d804 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -45,7 +45,7 @@ zval member; \ ZVAL_STRINGL(&member, name, sizeof(name)-1); \ zend_std_write_property(object, &member, value, NULL TSRMLS_CC); \ - Z_DELREF_P(value); \ + if (Z_REFCOUNTED_P(value)) Z_DELREF_P(value); \ zval_ptr_dtor(&member); \ } while (0) diff --git a/ext/standard/array.c b/ext/standard/array.c index 0535e57849..9664736f76 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1849,7 +1849,7 @@ PHPAPI HashTable* php_splice(HashTable *in_hash, int offset, int length, zval *l /* ..for each one, create a new zval, copy entry into it and copy it into the output hash */ for (i = 0; i < list_count; i++) { entry = &list[i]; - if (IS_REFCOUNTED(Z_TYPE_P(entry))) Z_ADDREF_P(entry); + if (Z_REFCOUNTED_P(entry)) Z_ADDREF_P(entry); zend_hash_next_index_insert(out_hash, entry); } } @@ -1859,7 +1859,7 @@ PHPAPI HashTable* php_splice(HashTable *in_hash, int offset, int length, zval *l p = in_hash->arData + idx; if (Z_TYPE(p->val) == IS_UNDEF) continue; entry = &p->val; - if (IS_REFCOUNTED(Z_TYPE_P(entry))) Z_ADDREF_P(entry); + if (Z_REFCOUNTED_P(entry)) Z_ADDREF_P(entry); if (p->key == NULL) { zend_hash_next_index_insert(out_hash, entry); } else { diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 078ea9098f..46ea0f52c0 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -5135,7 +5135,7 @@ PHP_FUNCTION(register_shutdown_function) } for (i = 0; i < shutdown_function_entry.arg_count; i++) { - Z_ADDREF(shutdown_function_entry.arguments[i]); + if (Z_REFCOUNTED(shutdown_function_entry.arguments[i])) Z_ADDREF(shutdown_function_entry.arguments[i]); } zend_hash_next_index_insert_mem(BG(user_shutdown_function_names), &shutdown_function_entry, sizeof(php_shutdown_function_entry)); } |
