cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit e8b57d5e943171add23fc3674a34dbbb93d49046
parent 9946adcf5ffcc00b1a8665649b42bdc35bf72d35
Author: Michael Forney <mforney@mforney.org>
Date:   Fri, 15 Feb 2019 19:52:02 -0800

Handle main with no return

Diffstat:
Mqbe.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qbe.c b/qbe.c @@ -1038,7 +1038,7 @@ emitfunc(struct function *f, bool global) size_t n; if (!f->end->terminated) - funcret(f, NULL); + funcret(f, strcmp(f->name, "main") == 0 ? mkintconst(&i32, 0) : NULL); if (global) puts("export"); fputs("function ", stdout);