Skip to content

Commit 8b55c4c

Browse files
committed
fixed: compiler crash on parsing error
1 parent 770174e commit 8b55c4c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/parser.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4278,7 +4278,9 @@ static void parse_top_level_statement(OnyxParser* parser) {
42784278
inject->token = dir_token;
42794279
inject->full_loc = (AstTyped *) injection_point;
42804280
inject->binding = parse_top_level_binding(parser, injection_point->token);
4281-
flush_doc_tokens(parser, &inject->binding->documentation_string, &inject->binding->documentation_token_old);
4281+
if (inject->binding) {
4282+
flush_doc_tokens(parser, &inject->binding->documentation_string, &inject->binding->documentation_token_old);
4283+
}
42824284

42834285
ENTITY_SUBMIT(inject);
42844286
return;

0 commit comments

Comments
 (0)