summaryrefslogtreecommitdiff
path: root/parse/specialize.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-09-26 13:21:11 -0700
committerOri Bernstein <ori@eigenstate.org>2015-09-26 13:21:11 -0700
commitf4a4987fb85dc9ea146146068734988bb046a3ab (patch)
tree3eac5098cdb2cd9a48996bedbeb26d52d2c0db9c /parse/specialize.c
parente1bd55e7d0fd87b66041c1f90cc4cba370cb25ed (diff)
downloadmc-f4a4987fb85dc9ea146146068734988bb046a3ab.tar.gz
Fix up constant initialization a bit.
Diffstat (limited to 'parse/specialize.c')
-rw-r--r--parse/specialize.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/parse/specialize.c b/parse/specialize.c
index 03f5295..dcf4316 100644
--- a/parse/specialize.c
+++ b/parse/specialize.c
@@ -501,10 +501,15 @@ void geninit(Node *file)
}
if (file->file.localinit)
callinit(block, file->file.localinit, tyvoid, tyvoidfn);
+
func = mkfunc(Zloc, NULL, 0, mktype(Zloc, Tyvoid), block);
func->expr.type = tyvoidfn;
- decl->decl.init = mkexpr(Zloc, Olit, func, NULL);
+ init = mkexpr(Zloc, Olit, func, NULL);
+ init->expr.type = tyvoidfn;
+
+ decl->decl.init = init;
decl->decl.isconst = 1;
+ decl->decl.isglobl = 1;
decl->decl.type = tyvoidfn;
decl->decl.vis = Vishidden;