summaryrefslogtreecommitdiff
path: root/6
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-12-05 01:10:24 -0800
committerOri Bernstein <ori@eigenstate.org>2017-12-05 01:10:24 -0800
commit858ba07669c28ac1e8e88ef0283fb71615cd86c4 (patch)
tree49df027ca7c50caebaeaef7cfa1f068534b5ddc4 /6
parent3360bf0e88b086b0c7f7957eeb4a6f0b4eaeebc7 (diff)
downloadmc-858ba07669c28ac1e8e88ef0283fb71615cd86c4.tar.gz
All extern consts should be global.
Diffstat (limited to '6')
-rw-r--r--6/simp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/6/simp.c b/6/simp.c
index 8db6d6b..323f761 100644
--- a/6/simp.c
+++ b/6/simp.c
@@ -181,7 +181,9 @@ forcelocal(Simp *s, Node *n)
static void
declarelocal(Simp *s, Node *n)
{
- if (isconstfn(n))
+ if (n->type == Nexpr)
+ n = decls[n->decl.did];
+ if (n->decl.isconst && n->decl.isextern)
htput(s->globls, n, asmname(n));
else if (stacknode(n))
forcelocal(s, n);