about summary refs log tree commit diff
path: root/boot/parse.c
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2025-07-10 00:59:36 +0200
committerMel <mel@rnrd.eu>2025-07-10 00:59:36 +0200
commitd7f66d5a286a1da1240d5f255b7ae171c8b6a93f (patch)
treebf2ec657f8d87e1f7572b5b728e42964211fe4d4 /boot/parse.c
parent4ef58f4d2b7ea810ab4d5db08fe45216f6597336 (diff)
downloadcatskill-d7f66d5a286a1da1240d5f255b7ae171c8b6a93f.tar.zst
catskill-d7f66d5a286a1da1240d5f255b7ae171c8b6a93f.zip
Fix nil-dereference in `parser_node_type_class`
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/parse.c')
-rw-r--r--boot/parse.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/boot/parse.c b/boot/parse.c
index 687659e..6363379 100644
--- a/boot/parse.c
+++ b/boot/parse.c
@@ -445,6 +445,7 @@ parser_function_header_node(struct Parser* p, struct Parser_Error* error)
     struct Token close_parameters_token = parser_next(p);
 
     header.span = span_merge(open_parameters_token.span, close_parameters_token.span);
+    header.location = open_parameters_token.location;
 
     struct Token next = parser_peek(p);
     struct Token further = parser_peek_further(p);
@@ -620,7 +621,7 @@ parser_node_type_class(struct Parser* p, struct Parser_Error* error)
         // for the sake of consistency and the built-in type node linked list.
         struct Type_Node* method_type = type_node_new(
             TYPE_NODE_FUNCTION, (union Type_Node_Value){ .function = { header } }, header.span,
-            header.parameters_type_and_name->location);
+            header.location);
         method_type->value_name = method_name;
 
         if (!head)