From 21932a0ef25a7055cd3c0850fa58c2fda2ba383b Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Wed, 5 Feb 2020 20:31:18 +0100 Subject: 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 --- src/parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/parser.cpp') diff --git a/src/parser.cpp b/src/parser.cpp index a4dc324b2f..0da7aac639 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -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; } -- cgit v1.2.3