From 3a77733275cacaa32b95440de053650d20cf4bee Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Sun, 10 Dec 2023 18:10:15 -0600 Subject: [PATCH] fixed: #81 parsing bug --- compiler/src/parser.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/src/parser.c b/compiler/src/parser.c index 5199e973..543e82be 100644 --- a/compiler/src/parser.c +++ b/compiler/src/parser.c @@ -3114,6 +3114,11 @@ static b32 parse_possible_quick_function_definition(OnyxParser* parser, AstTyped } else { AstTyped* body = parse_compound_expression(parser, 0); + if (body == NULL) { + onyx_report_error(parser->curr->pos, Error_Critical, "Expected an expression here."); + parser->hit_unexpected_token = 1; + return 0; + } AstReturn* return_node = make_node(AstReturn, Ast_Kind_Return); return_node->token = body->token; -- 2.25.1