diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-09-08 20:42:45 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-09-08 20:42:45 +0200 |
commit | cf8d7b3eaed6f38eafaaad7e6f384627e87ba3b5 (patch) | |
tree | 4f96eb1acbc16025de05d78a021502b4dd84d7d1 /Zend/zend_execute.c | |
parent | 5b78d76ec8a569c8b547ce1cb044a671bd976f46 (diff) | |
download | php-git-cf8d7b3eaed6f38eafaaad7e6f384627e87ba3b5.tar.gz |
Don't handle missing value in zend_verify_arg_error()
This error condition is handled separately, never reaches this
function.
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r-- | Zend/zend_execute.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 2c07eae9eb..4c63db6bd2 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -685,33 +685,29 @@ ZEND_API ZEND_COLD void zend_verify_arg_error( return; } - if (value) { - zend_verify_type_error_common( - zf, arg_info, value, &fname, &fsep, &fclass, &need_msg, &given_msg); - - if (zf->common.type == ZEND_USER_FUNCTION) { - if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) { - zend_type_error("%s%s%s(): Argument #%d ($%s) must be of type %s, %s given, called in %s on line %d", - fclass, fsep, fname, - arg_num, ZSTR_VAL(arg_info->name), - ZSTR_VAL(need_msg), given_msg, - ZSTR_VAL(ptr->func->op_array.filename), ptr->opline->lineno - ); - } else { - zend_type_error("%s%s%s(): Argument #%d ($%s) must be of type %s, %s given", - fclass, fsep, fname, arg_num, ZSTR_VAL(arg_info->name), ZSTR_VAL(need_msg), given_msg - ); - } + zend_verify_type_error_common( + zf, arg_info, value, &fname, &fsep, &fclass, &need_msg, &given_msg); + + if (zf->common.type == ZEND_USER_FUNCTION) { + if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) { + zend_type_error("%s%s%s(): Argument #%d ($%s) must be of type %s, %s given, called in %s on line %d", + fclass, fsep, fname, + arg_num, ZSTR_VAL(arg_info->name), + ZSTR_VAL(need_msg), given_msg, + ZSTR_VAL(ptr->func->op_array.filename), ptr->opline->lineno + ); } else { zend_type_error("%s%s%s(): Argument #%d ($%s) must be of type %s, %s given", - fclass, fsep, fname, arg_num, ((zend_internal_arg_info*) arg_info)->name, ZSTR_VAL(need_msg), given_msg + fclass, fsep, fname, arg_num, ZSTR_VAL(arg_info->name), ZSTR_VAL(need_msg), given_msg ); } - - zend_string_release(need_msg); } else { - zend_missing_arg_error(ptr); + zend_type_error("%s%s%s(): Argument #%d ($%s) must be of type %s, %s given", + fclass, fsep, fname, arg_num, ((zend_internal_arg_info*) arg_info)->name, ZSTR_VAL(need_msg), given_msg + ); } + + zend_string_release(need_msg); } static zend_bool zend_verify_weak_scalar_type_hint(uint32_t type_mask, zval *arg) |