Crash invoking a @body argument with the wrong number of parameters.

This commit is contained in:
Christoffer Lerno
2024-09-17 00:33:38 +02:00
parent 62887a6ce8
commit 08a575fa82
2 changed files with 2 additions and 0 deletions

View File

@@ -32,6 +32,7 @@
- Bug with casting anyfault to error.
- Lambda / function type would accidentally be processed as a method.
- Fix error message when not finding a particular function.
- Crash invoking a `@body` argument with the wrong number of parameters.
### Stdlib changes
- Additional init functions for hashmap.

View File

@@ -2374,6 +2374,7 @@ static bool sema_call_analyse_body_expansion(SemaContext *macro_context, Expr *c
if (expressions != vec_size(body_parameters))
{
PRINT_ERROR_AT(call, "Expected %d parameter(s) to %s.", vec_size(body_parameters), body_decl->name);
return false;
}
Expr **args = call_expr->arguments;