summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-10-02 16:33:20 -0700
committerOri Bernstein <ori@eigenstate.org>2015-10-02 16:33:20 -0700
commitea60cdb464fe0bb4d289fb841304a44539d24593 (patch)
tree0af13af354b2a10eaf8ce99afacacb09abb9f3dd /parse
parent6507bf31d345f0046a1415088e42390c8befdd97 (diff)
downloadmc-ea60cdb464fe0bb4d289fb841304a44539d24593.tar.gz
Allow redefinition of externs.
We don't want externs to conflict with their actual definition.
Diffstat (limited to 'parse')
-rw-r--r--parse/stab.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/parse/stab.c b/parse/stab.c
index c2eedb5..47e06af 100644
--- a/parse/stab.c
+++ b/parse/stab.c
@@ -232,6 +232,10 @@ static int mergedecl(Node *old, Node *new)
old->decl.ishidden = old->decl.ishidden && new->decl.ishidden;
return 1;
}
+ if (old->decl.isextern || new->decl.isextern) {
+ old->decl.isextern = old->decl.isextern && new->decl.isextern;
+ return 1;
+ }
if (old->decl.vis == Visexport && new->decl.vis != Visexport) {
e = old;
g = new;
@@ -271,6 +275,7 @@ static int mergedecl(Node *old, Node *new)
old->decl.isexportinit = e->decl.isexportinit || g->decl.isexportinit;
old->decl.isglobl = e->decl.isglobl || g->decl.isglobl;
old->decl.ispkglocal = e->decl.ispkglocal || g->decl.ispkglocal;
+ old->decl.isextern = e->decl.isextern || g->decl.isextern;
return 1;
}