summaryrefslogtreecommitdiff
path: root/6/main.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@markovcorp.com>2019-02-26 13:03:14 -0800
committerOri Bernstein <ori@markovcorp.com>2019-02-26 13:03:14 -0800
commit02201160614e5f25a7a73d86ed26a1f90fa4f5bb (patch)
treece958c6982673794612cf2ea91ab8b353bf4c243 /6/main.c
parent16a7bb8f8cc86b22ce157e0944f66f60a556590f (diff)
downloadmc-02201160614e5f25a7a73d86ed26a1f90fa4f5bb.tar.gz
Add support for `__fini__` functions.
Diffstat (limited to '6/main.c')
-rw-r--r--6/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/6/main.c b/6/main.c
index 5e3d6da..c980887 100644
--- a/6/main.c
+++ b/6/main.c
@@ -293,8 +293,12 @@ main(int argc, char **argv)
if (debugopt['T'])
dump(file, stdout);
loaduses();
- if (hasmain(file))
- geninit();
+ if (hasmain(file)) {
+ genautocall(file->file.init, file->file.ninit,
+ file->file.localinit, "__init__");
+ genautocall(file->file.fini, file->file.nfini,
+ file->file.localfini, "__fini__");
+ }
infer();
tagexports(0);
/* after all type inference */