mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
RC manipulation cleanup
This commit is contained in:
parent
0056f52f50
commit
a8a17a72b0
16 changed files with 168 additions and 408 deletions
|
@ -663,15 +663,13 @@ static void php_autoglobal_merge(HashTable *dest, HashTable *src)
|
|||
|| (string_key && (dest_entry = zend_hash_find(dest, string_key)) == NULL)
|
||||
|| (string_key == NULL && (dest_entry = zend_hash_index_find(dest, num_key)) == NULL)
|
||||
|| Z_TYPE_P(dest_entry) != IS_ARRAY) {
|
||||
if (Z_REFCOUNTED_P(src_entry)) {
|
||||
Z_ADDREF_P(src_entry);
|
||||
}
|
||||
Z_TRY_ADDREF_P(src_entry);
|
||||
if (string_key) {
|
||||
if (!globals_check || ZSTR_LEN(string_key) != sizeof("GLOBALS") - 1
|
||||
|| memcmp(ZSTR_VAL(string_key), "GLOBALS", sizeof("GLOBALS") - 1)) {
|
||||
zend_hash_update(dest, string_key, src_entry);
|
||||
} else if (Z_REFCOUNTED_P(src_entry)) {
|
||||
Z_DELREF_P(src_entry);
|
||||
} else {
|
||||
Z_TRY_DELREF_P(src_entry);
|
||||
}
|
||||
} else {
|
||||
zend_hash_index_update(dest, num_key, src_entry);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue