summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-10-25 10:27:45 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-10-25 10:27:45 +0200
commitbd7b1afd6eb623a4905673dfc92bb0de62f23edd (patch)
treef5e3080d2e34b0e31cba2cac0be233c5add930f9 /Zend/zend_execute.c
parent296269cfe81e7580e03701be3eecc0243ba8522a (diff)
downloadphp-git-bd7b1afd6eb623a4905673dfc92bb0de62f23edd.tar.gz
Check type is set when verifying variadic args
Weird that there was no test for this... This code is somewhat inefficient, because it will be performed for every arg, rather than only once.
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 7544742cd7..673840ace5 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1042,7 +1042,8 @@ static zend_always_inline int zend_verify_variadic_arg_type(zend_function *zf, u
ZEND_ASSERT(zf->common.fn_flags & ZEND_ACC_VARIADIC);
cur_arg_info = &zf->common.arg_info[zf->common.num_args];
- if (UNEXPECTED(!zend_check_type(cur_arg_info->type, arg, cache_slot, zf->common.scope, 0, 0))) {
+ if (ZEND_TYPE_IS_SET(cur_arg_info->type)
+ && UNEXPECTED(!zend_check_type(cur_arg_info->type, arg, cache_slot, zf->common.scope, 0, 0))) {
zend_verify_arg_error(zf, cur_arg_info, arg_num, cache_slot, arg);
return 0;
}