From 78bf3e039d77e3eb0d5e394273adb69b2b70a76d Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 17 Mar 2025 02:12:02 +0200 Subject: detect leaks --- src/ast.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/ast.c') diff --git a/src/ast.c b/src/ast.c index 08178f7..f491b55 100644 --- a/src/ast.c +++ b/src/ast.c @@ -201,6 +201,10 @@ void ast_dump(int depth, struct ast *n) switch (n->k) { DUMP(AST_CLOSURE); DUMP(AST_IF); + DUMP(AST_NIL); + DUMP(AST_OWN); + DUMP(AST_ERR_BRANCH); + DUMP(AST_ERROR); DUMP(AST_LET); DUMP(AST_INIT); DUMP(AST_CALL); @@ -558,7 +562,7 @@ void fix_closures(struct ast *root) assert(next); - struct ast *block = gen_block(next, root->loc); + struct ast *block = gen_block(next, NULL, root->loc); closure_body(arg) = block; root->n = NULL; root = next; @@ -627,6 +631,10 @@ const char *ast_str(enum ast_kind k) switch (k) { CASE(AST_CLOSURE); CASE(AST_IF); + CASE(AST_NIL); + CASE(AST_OWN); + CASE(AST_ERR_BRANCH); + CASE(AST_ERROR); CASE(AST_LET); CASE(AST_INIT); CASE(AST_CALL); -- cgit v1.2.3