aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-09-15 21:48:00 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-09-15 21:48:00 -0400
commitfda3c8546d56b17a1921e495ebc08bc429f06582 (patch)
tree43a1e9031392419c9c2e20e1cbcaa037857676ff
parent4b34d642384d6237c0af46fb48ec9e8bd98efad0 (diff)
Add frees id_list/type trees after update ID types
-rw-r--r--tree.c8
1 files 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;
}