From fda3c8546d56b17a1921e495ebc08bc429f06582 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Sun, 15 Sep 2019 21:48:00 -0400 Subject: Add frees id_list/type trees after update ID types --- tree.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tree.c b/tree.c index 9b32f15..fc602a2 100644 --- a/tree.c +++ b/tree.c @@ -73,15 +73,13 @@ ptree *list, *t; info->size = t->r->attr.ival - t->l->attr.ival; info->start_idx = t->l->attr.ival; } + free_tree(t); if (list->type == ID) { list->attr.nval->var_type = type; if (info) list->attr.nval->array_info = info; - return; - } - - while (list->r && list->r->type == ID) { + } else while (list->r && list->r->type == ID) { /*Set type of right child through list*/ list->r->attr.nval->var_type = type; if (info) @@ -103,7 +101,7 @@ ptree *list, *t; break; /*At _end_ of list (did not continue)*/ } - /*TODO free t. and list?*/ + free_tree(list); return; } -- cgit v1.1