diff --git a/releasenotes.md b/releasenotes.md index 5f290dc26..9c6a9e4dd 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -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. diff --git a/src/compiler/sema_expr.c b/src/compiler/sema_expr.c index 166b9d3df..56b7277e8 100644 --- a/src/compiler/sema_expr.c +++ b/src/compiler/sema_expr.c @@ -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;