From df8d9689d10be3dd92e7930bd357e49476f23c49 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Thu, 3 Apr 2025 10:48:41 +0100 Subject: [PATCH] lang: add null pointer check to arith_parse_left_paren this fixes a crash that occurred when the call-operator was used on a lone ident in an expression. --- lang/ast/expr/arith.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/ast/expr/arith.c b/lang/ast/expr/arith.c index 7657426..fb36d2a 100644 --- a/lang/ast/expr/arith.c +++ b/lang/ast/expr/arith.c @@ -598,7 +598,7 @@ struct token_parse_result arith_parse_left_paren( struct ivy_ast_node *msg = b_unbox(struct ivy_ast_node, msg_entry, n_entry); - if (msg->n_type != IVY_AST_MSG) { + if (!msg || msg->n_type != IVY_AST_MSG) { /* this is not a complex message, it's probably a * call-operator */ goto not_complex_msg;