summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2013-04-02 12:51:53 -0400
committerOri Bernstein <ori@eigenstate.org>2013-04-02 12:51:53 -0400
commitc4b6a1c57ece9e02c05f046f4dd472f6d8c6ec6b (patch)
tree529071056dd23e34ff59db002cf1ed905a50b88d
parentd45d6cb5b1db467f990332c88492e57f687fa316 (diff)
downloadmc-c4b6a1c57ece9e02c05f046f4dd472f6d8c6ec6b.tar.gz
Error out on failing to respolve namespaces.
Don't segfault.
-rw-r--r--parse/infer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/parse/infer.c b/parse/infer.c
index 9707be9..e58c4dd 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -262,6 +262,8 @@ static Type *tf(Inferstate *st, Type *t)
if (t->name->name.ns) {
ns = getns_str(ns, t->name->name.ns);
}
+ if (!ns)
+ fatal(t->name->line, "Could not resolve namespace \"%s\"", t->name->name.ns);
if (!(lu = gettype(ns, t->name)))
fatal(t->name->line, "Could not resolve type %s", namestr(t->name));
tytab[t->tid] = lu;