]> granicus.if.org Git - php/commitdiff
Add RC flags in init_func_return_info
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 17 Feb 2018 17:42:08 +0000 (18:42 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 17 Feb 2018 22:18:29 +0000 (23:18 +0100)
ext/opcache/Optimizer/zend_inference.c

index 9e58b9fd73fb5c700face6f4eb594e0fb879bea4..10db7a00423c5ab505e4c6e85e3f9b1fd83f0633 100644 (file)
@@ -3699,6 +3699,8 @@ void zend_init_func_return_info(const zend_op_array   *op_array,
                ret->type = zend_fetch_arg_info(script, ret_info, &ret->ce);
                if (op_array->fn_flags & ZEND_ACC_RETURN_REFERENCE) {
                        ret->type |= MAY_BE_REF;
+               } else if (ret->type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
+                       ret->type |= MAY_BE_RC1|MAY_BE_RCN;
                }
                ret->is_instanceof = (ret->ce) ? 1 : 0;
                ret->range = tmp_range;