Drop unneessary if branch and adjust arg_num type

This if branch seems to be a remain of when certain type errors where E_WARNINGs, something which isn't the case since PHP 8.0.
This commit is contained in:
George Peter Banyard 2021-03-25 02:12:06 +00:00
parent 6c89359124
commit 56c18c4038
2 changed files with 2 additions and 8 deletions

View file

@ -685,19 +685,13 @@ static ZEND_COLD void zend_verify_type_error_common(
}
ZEND_API ZEND_COLD void zend_verify_arg_error(
const zend_function *zf, const zend_arg_info *arg_info, int arg_num, zval *value)
const zend_function *zf, const zend_arg_info *arg_info, uint32_t arg_num, zval *value)
{
zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
const char *fname, *fsep, *fclass;
zend_string *need_msg;
const char *given_msg;
if (EG(exception)) {
/* The type verification itself might have already thrown an exception
* through a promoted warning. */
return;
}
zend_verify_type_error_common(
zf, arg_info, value, &fname, &fsep, &fclass, &need_msg, &given_msg);

View file

@ -70,7 +70,7 @@ ZEND_API ZEND_COLD zend_result ZEND_FASTCALL zend_undefined_index_write(HashTabl
ZEND_API bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, bool strict, bool is_internal_arg);
ZEND_API ZEND_COLD void zend_verify_arg_error(
const zend_function *zf, const zend_arg_info *arg_info, int arg_num, zval *value);
const zend_function *zf, const zend_arg_info *arg_info, uint32_t arg_num, zval *value);
ZEND_API ZEND_COLD void zend_verify_return_error(
const zend_function *zf, zval *value);
ZEND_API bool zend_verify_ref_array_assignable(zend_reference *ref);