diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 541c5f06fb1..f56005450ce 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -832,9 +832,6 @@ int zend_add_literal(zend_op_array *op_array, zval *zv); static zend_always_inline int zend_check_arg_send_type(const zend_function *zf, uint32_t arg_num, uint32_t mask) { - if (UNEXPECTED(zf->common.arg_info == NULL)) { - return 0; - } arg_num--; if (UNEXPECTED(arg_num >= zf->common.num_args)) { if (EXPECTED((zf->common.fn_flags & ZEND_ACC_VARIADIC) == 0)) { diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index aaa25cabcaf..35dd10feb2f 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -615,10 +615,6 @@ static void zend_verify_internal_arg_type(zend_function *zf, uint32_t arg_num, z char *need_msg; zend_class_entry *ce; - if (UNEXPECTED(!zf->internal_function.arg_info)) { - return; - } - if (EXPECTED(arg_num <= zf->internal_function.num_args)) { cur_arg_info = &zf->internal_function.arg_info[arg_num-1]; } else if (zf->internal_function.fn_flags & ZEND_ACC_VARIADIC) { @@ -664,10 +660,6 @@ static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, char *need_msg; zend_class_entry *ce; - if (UNEXPECTED(!zf->common.arg_info)) { - return; - } - if (EXPECTED(arg_num <= zf->common.num_args)) { cur_arg_info = &zf->common.arg_info[arg_num-1]; } else if (zf->common.fn_flags & ZEND_ACC_VARIADIC) { @@ -713,10 +705,6 @@ static inline int zend_verify_missing_arg_type(zend_function *zf, uint32_t arg_n char *need_msg; zend_class_entry *ce; - if (UNEXPECTED(!zf->common.arg_info)) { - return 1; - } - if (EXPECTED(arg_num <= zf->common.num_args)) { cur_arg_info = &zf->common.arg_info[arg_num-1]; } else if (zf->common.fn_flags & ZEND_ACC_VARIADIC) { diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index c6ceeefe005..45e8b09c407 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2788,9 +2788,10 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY) if (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) { uint32_t i; + uint32_t num_args = ZEND_CALL_NUM_ARGS(call); zval *p = ZEND_CALL_ARG(call, 1); - for (i = 0; i < ZEND_CALL_NUM_ARGS(call); ++i) { + for (i = 0; i < num_args; ++i) { zend_verify_internal_arg_type(fbc, i + 1, p); p++; } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index c1f5e27c3f0..d087b05d896 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -535,9 +535,10 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) { uint32_t i; + uint32_t num_args = ZEND_CALL_NUM_ARGS(call); zval *p = ZEND_CALL_ARG(call, 1); - for (i = 0; i < ZEND_CALL_NUM_ARGS(call); ++i) { + for (i = 0; i < num_args; ++i) { zend_verify_internal_arg_type(fbc, i + 1, p); p++; }