summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);