summaryrefslogtreecommitdiff
path: root/6
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-12-04 23:50:46 -0800
committerOri Bernstein <ori@eigenstate.org>2017-12-04 23:50:46 -0800
commitfd1b8b6f31b7a8c2705c3ac01e46fd707c0d3c9e (patch)
tree2f0d8af7b72dded6b57c64bb58cd2aa89fa5e479 /6
parentebbdfc2631ac5876397ccc52453b69cfd223c95d (diff)
downloadmc-fd1b8b6f31b7a8c2705c3ac01e46fd707c0d3c9e.tar.gz
Handle locally declared extern consts correctly.
Ugh. Edge cases.
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 41fa010..8db6d6b 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 (stacknode(n))
+ if (isconstfn(n))
+ htput(s->globls, n, asmname(n));
+ else if (stacknode(n))
forcelocal(s, n);
}