Skip to content

Commit fd4844e

Browse files
committed
Removed useless checks
1 parent e0e2d50 commit fd4844e

File tree

4 files changed

+4
-17
lines changed

4 files changed

+4
-17
lines changed

Zend/zend_compile.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -832,9 +832,6 @@ int zend_add_literal(zend_op_array *op_array, zval *zv);
832832

833833
static zend_always_inline int zend_check_arg_send_type(const zend_function *zf, uint32_t arg_num, uint32_t mask)
834834
{
835-
if (UNEXPECTED(zf->common.arg_info == NULL)) {
836-
return 0;
837-
}
838835
arg_num--;
839836
if (UNEXPECTED(arg_num >= zf->common.num_args)) {
840837
if (EXPECTED((zf->common.fn_flags & ZEND_ACC_VARIADIC) == 0)) {

Zend/zend_execute.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -615,10 +615,6 @@ static void zend_verify_internal_arg_type(zend_function *zf, uint32_t arg_num, z
615615
char *need_msg;
616616
zend_class_entry *ce;
617617

618-
if (UNEXPECTED(!zf->internal_function.arg_info)) {
619-
return;
620-
}
621-
622618
if (EXPECTED(arg_num <= zf->internal_function.num_args)) {
623619
cur_arg_info = &zf->internal_function.arg_info[arg_num-1];
624620
} 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,
664660
char *need_msg;
665661
zend_class_entry *ce;
666662

667-
if (UNEXPECTED(!zf->common.arg_info)) {
668-
return;
669-
}
670-
671663
if (EXPECTED(arg_num <= zf->common.num_args)) {
672664
cur_arg_info = &zf->common.arg_info[arg_num-1];
673665
} 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
713705
char *need_msg;
714706
zend_class_entry *ce;
715707

716-
if (UNEXPECTED(!zf->common.arg_info)) {
717-
return 1;
718-
}
719-
720708
if (EXPECTED(arg_num <= zf->common.num_args)) {
721709
cur_arg_info = &zf->common.arg_info[arg_num-1];
722710
} else if (zf->common.fn_flags & ZEND_ACC_VARIADIC) {

Zend/zend_vm_def.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2788,9 +2788,10 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
27882788

27892789
if (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) {
27902790
uint32_t i;
2791+
uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
27912792
zval *p = ZEND_CALL_ARG(call, 1);
27922793

2793-
for (i = 0; i < ZEND_CALL_NUM_ARGS(call); ++i) {
2794+
for (i = 0; i < num_args; ++i) {
27942795
zend_verify_internal_arg_type(fbc, i + 1, p);
27952796
p++;
27962797
}

Zend/zend_vm_execute.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,10 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
535535

536536
if (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) {
537537
uint32_t i;
538+
uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
538539
zval *p = ZEND_CALL_ARG(call, 1);
539540

540-
for (i = 0; i < ZEND_CALL_NUM_ARGS(call); ++i) {
541+
for (i = 0; i < num_args; ++i) {
541542
zend_verify_internal_arg_type(fbc, i + 1, p);
542543
p++;
543544
}

0 commit comments

Comments
 (0)