summaryrefslogtreecommitdiff
path: root/6/simp.c
diff options
context:
space:
mode:
Diffstat (limited to '6/simp.c')
-rw-r--r--6/simp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/6/simp.c b/6/simp.c
index c4aeb5f..d277e22 100644
--- a/6/simp.c
+++ b/6/simp.c
@@ -1440,7 +1440,9 @@ static void simpconstinit(Simp *s, Node *dcl)
simpcode(s, e);
else
lappend(&s->blobs, &s->nblobs, dcl);
- } else if (dcl->decl.isconst) {
+ } else if (!dcl->decl.isconst && !e) {
+ lappend(&s->blobs, &s->nblobs, dcl);
+ } else if (e->expr.isconst) {
switch (exprop(e)) {
case Oarr:
case Ostruct:
@@ -1452,8 +1454,6 @@ static void simpconstinit(Simp *s, Node *dcl)
fatal(dcl, "unsupported initializer for %s", declname(dcl));
break;
}
- } else if (!dcl->decl.isconst && !e) {
- lappend(&s->blobs, &s->nblobs, dcl);
} else {
die("Non-constant initializer for %s\n", declname(dcl));
}