aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-10-09 07:40:06 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-10-09 07:40:06 -0400
commita2dc6a991277d3079579b247be18369e981baed2 (patch)
tree591ebbae9d7fcb59ac6bac301578381f1365fdf8
parent85994d17bb296c2041ac1eee03fc83087118a4fb (diff)
Add funcs now have scope offsets for return vars
-rw-r--r--pc.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/pc.y b/pc.y
index ec7f1e5..f619655 100644
--- a/pc.y
+++ b/pc.y
@@ -245,6 +245,8 @@ sub_prog_head
assert(!set_func_types($3, tmp->func_info->argv, i));
tmp->var_type = $5;
+
+ tmp->offset = ss[j]->offset++;
}
update_offsets($3, -2);
@@ -255,6 +257,7 @@ sub_prog_head
/* Fuction name already strdup for function, no need here*/
cur_scope->ret_var = mknode($2);
cur_scope->ret_var->var_type = $5;
+ cur_scope->ret_var->offset=cur_scope->offset - 1;
$$ = mktree(FUNC, mkid(tmp), NULL);