summaryrefslogtreecommitdiff
path: root/6/gengas.c
diff options
context:
space:
mode:
Diffstat (limited to '6/gengas.c')
-rw-r--r--6/gengas.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/6/gengas.c b/6/gengas.c
index 968fbe1..d315684 100644
--- a/6/gengas.c
+++ b/6/gengas.c
@@ -348,6 +348,7 @@ static void genfunc(FILE *fd, Func *fn, Htab *globls, Htab *strtab)
{
Isel is = {0,};
+ resetregs();
is.reglocs = mkht(varhash, vareq);
is.name = fn->name;
is.stkoff = fn->stkoff;
@@ -355,6 +356,7 @@ static void genfunc(FILE *fd, Func *fn, Htab *globls, Htab *strtab)
is.globls = globls;
is.ret = fn->ret;
is.cfg = fn->cfg;
+
if (fn->hasenv)
is.envp = locreg(ModeQ);