summaryrefslogtreecommitdiff
path: root/parse/node.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-07-07 00:13:11 -0700
committerOri Bernstein <ori@eigenstate.org>2017-07-07 00:13:11 -0700
commit05bf3792e6d06881e17d95714527e7e1e0d43ea7 (patch)
tree0735479b5045e8b7466db80ad7e86db8b49d0468 /parse/node.c
parentc4deee0e03693c12e0d22c233455ca2d1d6aa0ed (diff)
parent5889fbb13b415134e0d5b094359e351f5ff94fc3 (diff)
downloadmc-05bf3792e6d06881e17d95714527e7e1e0d43ea7.tar.gz
Merge branch 'master' into qbe
Diffstat (limited to 'parse/node.c')
-rw-r--r--parse/node.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/parse/node.c b/parse/node.c
index 29ab2ef..d8eae7d 100644
--- a/parse/node.c
+++ b/parse/node.c
@@ -186,6 +186,7 @@ Node *mkfunc(Srcloc loc, Node **args, size_t nargs, Type *ret, Node *body)
Node *n;
Node *f;
size_t i;
+ Stab *st;
f = mknode(loc, Nfunc);
f->func.args = args;
@@ -194,8 +195,9 @@ Node *mkfunc(Srcloc loc, Node **args, size_t nargs, Type *ret, Node *body)
f->func.scope = mkstab(1);
f->func.type = mktyfunc(loc, args, nargs, ret);
+ st = body->block.scope;
for (i = 0; i < nargs; i++)
- putdcl(f->func.scope, args[i]);
+ putdcl(st, args[i]);
n = mknode(loc, Nlit);
n->lit.littype = Lfunc;