summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-11-30 17:13:36 -0800
committerOri Bernstein <ori@eigenstate.org>2014-11-30 17:13:36 -0800
commitd534f4ba7940abe04a5e8e12b3b41a86dc0a7107 (patch)
tree7ebcc66af38bb15333f216f02ab67c82e501079b
parent7d590b64d3ad57239c8835b2fd1a0d2db2b2981a (diff)
downloadmc-d534f4ba7940abe04a5e8e12b3b41a86dc0a7107.tar.gz
Fix a couple of assert failures.
-rw-r--r--6/simp.c4
-rw-r--r--parse/infer.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/6/simp.c b/6/simp.c
index 4874a38..f2c9ba3 100644
--- a/6/simp.c
+++ b/6/simp.c
@@ -822,7 +822,7 @@ static Node *lval(Simp *s, Node *n)
case Oderef: r = deref(rval(s, args[0], NULL), NULL); break;
case Omemb: r = deref(membaddr(s, n), NULL); break;
default:
- die("%s cannot be an lval", opstr(exprop(n)));
+ fatal(n, "%s cannot be an lvalue", opstr(exprop(n)));
break;
}
return r;
@@ -1674,7 +1674,7 @@ static void simpconstinit(Simp *s, Node *dcl)
lappend(&s->blobs, &s->nblobs, dcl);
break;
default:
- die("Unsupported initializer for %s\n", declname(dcl));
+ fatal(dcl, "unsupported initializer for %s", declname(dcl));
break;
}
} else if (!dcl->decl.isconst && !e) {
diff --git a/parse/infer.c b/parse/infer.c
index d32c8ed..7a5058c 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -1059,6 +1059,8 @@ static void checkns(Inferstate *st, Node *n, Node **ret)
/* check that this is a namespaced declaration */
if (n->type != Nexpr)
return;
+ if (exprop(n) != Omemb)
+ return;
if (!n->expr.nargs)
return;
args = n->expr.args;