ref: d534f4ba7940abe04a5e8e12b3b41a86dc0a7107
parent: 7d590b64d3ad57239c8835b2fd1a0d2db2b2981a
author: Ori Bernstein <[email protected]>
date: Sun Nov 30 12:13:36 EST 2014
Fix a couple of assert failures.
--- a/6/simp.c
+++ b/6/simp.c
@@ -822,7 +822,7 @@
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 @@
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) {
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -1059,6 +1059,8 @@
/* 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;