diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-10-09 00:59:45 -0400 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-10-09 00:59:45 -0400 |
commit | eee5bfa0f14573eb56b5404c55e5ea25f09f53d8 (patch) | |
tree | fa8330b56ac4d2c0e4638bf3a849ad49c0c75599 | |
parent | 4fad63bffa5d91f566737090e3476cddbf59ed3b (diff) |
Fix scope offsets
-rw-r--r-- | pc.y | 7 | ||||
-rw-r--r-- | scope.c | 1 |
2 files changed, 5 insertions, 3 deletions
@@ -247,7 +247,8 @@ sub_prog_head tmp->var_type = $5; } - update_offsets($3, -1); + update_offsets($3, -2); + cur_scope->offset -= i; free_tree($3); @@ -277,7 +278,8 @@ sub_prog_head assert(!set_func_types($3, tmp->func_info->argv, i)); - update_offsets($3, -1); + update_offsets($3, -2); + cur_scope->offset -= i; free_tree($3); $$ = mktree(PROC, mkid(tmp), NULL); @@ -287,7 +289,6 @@ sub_prog_head arguments :'(' param_list ')' { - cur_scope->offset -= count_args($2); $$ = $2; } |/*empty*/{ @@ -21,6 +21,7 @@ scope* mkscope() p->prev = NULL; p->ret_var= NULL; + p->offset = 2; return p; } |