From a2dc6a991277d3079579b247be18369e981baed2 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Wed, 9 Oct 2019 07:40:06 -0400 Subject: Add funcs now have scope offsets for return vars --- pc.y | 3 +++ 1 file changed, 3 insertions(+) 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); -- cgit v1.1