diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-10-09 07:40:06 -0400 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-10-09 07:40:06 -0400 |
commit | a2dc6a991277d3079579b247be18369e981baed2 (patch) | |
tree | 591ebbae9d7fcb59ac6bac301578381f1365fdf8 | |
parent | 85994d17bb296c2041ac1eee03fc83087118a4fb (diff) |
Add funcs now have scope offsets for return vars
-rw-r--r-- | pc.y | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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); |