aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pc.y4
-rw-r--r--tree.c1
2 files changed, 4 insertions, 1 deletions
diff --git a/pc.y b/pc.y
index 673de92..ec78f22 100644
--- a/pc.y
+++ b/pc.y
@@ -98,6 +98,7 @@ program
set_ret_type($9);
print_tree($9);
free_tree($9);
+ free_tree($4);
#ifdef DEBUG
print_scope(cur_scope);
#endif
@@ -129,6 +130,7 @@ var_declarations
:var_declarations VAR id_list ':' type ';'
{
update_type_info($3, $5);
+ free_tree($3);
}
|/*empty*/
;
@@ -195,6 +197,7 @@ sub_prog_head
assert(tmp->func_info->argv = malloc(i * sizeof(int)));
assert(!set_func_types($3, tmp->func_info->argv, i));
+ free_tree($3);
tmp->var_type = $5;
@@ -217,6 +220,7 @@ sub_prog_head
assert(tmp->func_info->argv = malloc(i * sizeof(int)));
assert(!set_func_types($3, tmp->func_info->argv, i));
+ free_tree($3);
}
;
diff --git a/tree.c b/tree.c
index fc602a2..d218eed 100644
--- a/tree.c
+++ b/tree.c
@@ -101,7 +101,6 @@ ptree *list, *t;
break; /*At _end_ of list (did not continue)*/
}
- free_tree(list);
return;
}