summaryrefslogtreecommitdiff
path: root/parse/stab.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-10-01 21:56:47 -0700
committerOri Bernstein <ori@eigenstate.org>2015-10-01 22:35:32 -0700
commitb6368fd6d548d07f3a94e782579badab14790821 (patch)
treec8cb2486c21ef027aef05d8d2cccc6c5d8ee8cab /parse/stab.c
parent31dc0048af3102df08524099df2f005f547a2421 (diff)
downloadmc-b6368fd6d548d07f3a94e782579badab14790821.tar.gz
Don't double-insert namespaces.
updatens() was changed at some point to register the namespace. We don't need to put it in again after we call it, and in fact, we crash if we do.
Diffstat (limited to 'parse/stab.c')
-rw-r--r--parse/stab.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/parse/stab.c b/parse/stab.c
index a17efeb..c2eedb5 100644
--- a/parse/stab.c
+++ b/parse/stab.c
@@ -292,7 +292,6 @@ void putdcl(Stab *st, Node *s)
if (!ns) {
ns = mkstab(0);
updatens(ns, name->name.ns);
- putns(file->file.globls, ns);
}
st = ns;
}
@@ -438,13 +437,13 @@ Node *getimpl(Stab *st, Node *n)
return NULL;
}
-void putns(Stab *st, Stab *scope)
+void putns(Node *file, Stab *scope)
{
Stab *s;
s = getns(file, scope->name);
if (s)
- lfatal(Zloc, "Namespace %s already defined", st->name);
+ lfatal(Zloc, "Namespace %s already defined", scope->name);
htput(file->file.ns, scope->name, scope);
}