@@ -970,10 +970,7 @@ static zend_always_inline zend_bool zend_check_type(
970
970
{
971
971
zend_reference * ref = NULL ;
972
972
uint32_t type_mask ;
973
-
974
- if (!ZEND_TYPE_IS_SET (type )) {
975
- return 1 ;
976
- }
973
+ ZEND_ASSERT (ZEND_TYPE_IS_SET (type ));
977
974
978
975
if (UNEXPECTED (Z_ISREF_P (arg ))) {
979
976
ref = Z_REF_P (arg );
@@ -1023,12 +1020,13 @@ static zend_always_inline zend_bool zend_check_type(
1023
1020
1024
1021
static zend_always_inline int zend_verify_recv_arg_type (zend_function * zf , uint32_t arg_num , zval * arg , void * * cache_slot )
1025
1022
{
1026
- zend_arg_info * cur_arg_info = & zf -> common . arg_info [ arg_num - 1 ] ;
1023
+ zend_arg_info * cur_arg_info ;
1027
1024
1028
1025
ZEND_ASSERT (arg_num <= zf -> common .num_args );
1029
1026
cur_arg_info = & zf -> common .arg_info [arg_num - 1 ];
1030
1027
1031
- if (UNEXPECTED (!zend_check_type (cur_arg_info -> type , arg , cache_slot , zf -> common .scope , 0 , 0 ))) {
1028
+ if (ZEND_TYPE_IS_SET (cur_arg_info -> type )
1029
+ && UNEXPECTED (!zend_check_type (cur_arg_info -> type , arg , cache_slot , zf -> common .scope , 0 , 0 ))) {
1032
1030
zend_verify_arg_error (zf , cur_arg_info , arg_num , cache_slot , arg );
1033
1031
return 0 ;
1034
1032
}
@@ -1070,7 +1068,8 @@ static zend_never_inline ZEND_ATTRIBUTE_UNUSED int zend_verify_internal_arg_type
1070
1068
break ;
1071
1069
}
1072
1070
1073
- if (UNEXPECTED (!zend_check_type (cur_arg_info -> type , arg , & dummy_cache_slot , fbc -> common .scope , 0 , /* is_internal */ 1 ))) {
1071
+ if (ZEND_TYPE_IS_SET (cur_arg_info -> type )
1072
+ && UNEXPECTED (!zend_check_type (cur_arg_info -> type , arg , & dummy_cache_slot , fbc -> common .scope , 0 , /* is_internal */ 1 ))) {
1074
1073
return 0 ;
1075
1074
}
1076
1075
arg ++ ;
0 commit comments