diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-05-27 16:14:16 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-05-27 16:14:16 +0200 |
commit | 7cc17c4aac961150f5372b4927b13a0ee4993a05 (patch) | |
tree | 76a5e1f4f2f166c00e14a07599ee9538a6acf148 | |
parent | 6a4ec6c7e4382dcffe0f150468271299704cf4e3 (diff) | |
parent | 62f339c8d5071c46005a3fa1ee44563347bdc5c5 (diff) | |
download | php-git-7cc17c4aac961150f5372b4927b13a0ee4993a05.tar.gz |
Merge branch 'PHP-7.3' into PHP-7.4
-rw-r--r-- | ext/opcache/Optimizer/zend_func_info.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/ext/opcache/Optimizer/zend_func_info.c b/ext/opcache/Optimizer/zend_func_info.c index d54b4bbb4b..1355e1fd1a 100644 --- a/ext/opcache/Optimizer/zend_func_info.c +++ b/ext/opcache/Optimizer/zend_func_info.c @@ -1611,8 +1611,9 @@ int zend_func_info_rid = -1; uint32_t zend_get_func_info(const zend_call_info *call_info, const zend_ssa *ssa) { uint32_t ret = 0; + const zend_function *callee_func = call_info->callee_func; - if (call_info->callee_func->type == ZEND_INTERNAL_FUNCTION) { + if (callee_func->type == ZEND_INTERNAL_FUNCTION) { zval *zv; func_info_t *info; @@ -1623,9 +1624,10 @@ uint32_t zend_get_func_info(const zend_call_info *call_info, const zend_ssa *ssa ret = MAY_BE_NULL; } else if (info->info_func) { ret = info->info_func(call_info, ssa); - } else if (/*call_info->callee_func->common.arg_info && */ - call_info->callee_func->common.num_args == 0 && - call_info->callee_func->common.required_num_args == 0) { + } else if (/*callee_func->common.arg_info && */ + callee_func->common.num_args == 0 && + callee_func->common.required_num_args == 0 && + !(callee_func->common.fn_flags & ZEND_ACC_VARIADIC)) { if (call_info->num_args == 0) { ret = info->info; } else { @@ -1641,19 +1643,19 @@ uint32_t zend_get_func_info(const zend_call_info *call_info, const zend_ssa *ssa } } else { // FIXME: the order of functions matters!!! - zend_func_info *info = ZEND_FUNC_INFO((zend_op_array*)call_info->callee_func); + zend_func_info *info = ZEND_FUNC_INFO((zend_op_array*)callee_func); if (info) { ret = info->return_info.type; } } if (!ret) { ret = MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF; - if (call_info->callee_func->type == ZEND_INTERNAL_FUNCTION) { + if (callee_func->type == ZEND_INTERNAL_FUNCTION) { ret |= FUNC_MAY_WARN; } - if (call_info->callee_func->common.fn_flags & ZEND_ACC_GENERATOR) { + if (callee_func->common.fn_flags & ZEND_ACC_GENERATOR) { ret = MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_OBJECT; - } else if (call_info->callee_func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) { + } else if (callee_func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) { ret |= MAY_BE_REF; } else { ret |= MAY_BE_RC1 | MAY_BE_RCN; |