Fix edge case in cast between fn with varargs
* Prevent the next_param_index to become greater than the param_count one as it's expected by every other function. * Fix a typo in a error message. Closes #4381
This commit is contained in:
@@ -806,7 +806,7 @@ static AstNode *ast_parse_fn_proto(ParseContext *pc) {
|
||||
if (param_decl->data.param_decl.is_var_args)
|
||||
res->data.fn_proto.is_var_args = true;
|
||||
if (i != params.length - 1 && res->data.fn_proto.is_var_args)
|
||||
ast_error(pc, first, "Function prototype have varargs as a none last paramter.");
|
||||
ast_error(pc, first, "Function prototype have varargs as a none last parameter.");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user