Removed useless checks

This commit is contained in:
Dmitry Stogov 2014-12-22 19:04:29 +03:00
parent e0e2d50046
commit fd4844e079
4 changed files with 4 additions and 17 deletions

View File

@ -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)) {

View File

@ -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) {

View File

@ -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++;
}

View File

@ -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++;
}