summaryrefslogtreecommitdiff
path: root/main/php_variables.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2017-11-01 10:25:10 +0800
committerXinchen Hui <laruence@gmail.com>2017-11-01 10:25:10 +0800
commita8a17a72b06e6ea39a70eaf45ad2c3d6668e29ba (patch)
tree4cae24e0c78f7580e707bcab3d19729eca3b318c /main/php_variables.c
parent0056f52f500f9056039e8976e1100c9f154daa75 (diff)
downloadphp-git-a8a17a72b06e6ea39a70eaf45ad2c3d6668e29ba.tar.gz
RC manipulation cleanup
Diffstat (limited to 'main/php_variables.c')
-rw-r--r--main/php_variables.c8
1 files changed, 3 insertions, 5 deletions
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);