summaryrefslogtreecommitdiff
path: root/mi
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 /mi
parentebbdfc2631ac5876397ccc52453b69cfd223c95d (diff)
downloadmc-fd1b8b6f31b7a8c2705c3ac01e46fd707c0d3c9e.tar.gz
Handle locally declared extern consts correctly.
Ugh. Edge cases.
Diffstat (limited to 'mi')
-rw-r--r--mi/flatten.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mi/flatten.c b/mi/flatten.c
index 9ef2c70..1b95d0f 100644
--- a/mi/flatten.c
+++ b/mi/flatten.c
@@ -1081,7 +1081,9 @@ isconstfn(Node *n)
d = n;
}
t = tybase(decltype(d));
- if (!d || !d->decl.isconst || !d->decl.isglobl || d->decl.isgeneric)
+ if (!d || !d->decl.isconst || d->decl.isgeneric)
+ return 0;
+ if (!d->decl.isglobl && !d->decl.isextern)
return 0;
if (t->type != Tyfunc && t->type != Tycode)
return 0;