From a8a17a72b06e6ea39a70eaf45ad2c3d6668e29ba Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Wed, 1 Nov 2017 10:25:10 +0800 Subject: RC manipulation cleanup --- main/php_variables.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'main/php_variables.c') diff --git a/main/php_variables.c b/main/php_variables.c index 1052e16edf..6d0970c85f 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -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); -- cgit v1.2.1