diff --git a/src/ast.c b/src/ast.c index 88ea491..23121ff 100644 --- a/src/ast.c +++ b/src/ast.c @@ -9,8 +9,10 @@ ast* astCreate (astTag tag, tokenLocation location) { ast* Node = calloc(1, sizeof(ast)); - Node->tag = tag; - Node->location = location; + if (Node) { + Node->tag = tag; + Node->location = location; + } return Node; }