aboutsummaryrefslogtreecommitdiffstats
path: root/csc/compiler.csc
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-07-29 17:52:54 -0700
committerRose Hogenson <rhogenson@posteo.net>2022-07-29 17:52:54 -0700
commit762431b0f0a6ead18a93a05c0f3269dca5b8fef1 (patch)
tree068057d0da92aa852fd4674477f7f50784e7f652 /csc/compiler.csc
parentdfbe145901a9843809ad842f9e9c6b1bf631c97e (diff)
downloadchromatopelma-762431b0f0a6ead18a93a05c0f3269dca5b8fef1.tar.zst
Insert an exit op at the end of the program.
Diffstat (limited to 'csc/compiler.csc')
-rw-r--r--csc/compiler.csc2
1 files changed, 1 insertions, 1 deletions
diff --git a/csc/compiler.csc b/csc/compiler.csc
index fcf7598..20d5d37 100644
--- a/csc/compiler.csc
+++ b/csc/compiler.csc
@@ -160,5 +160,5 @@
(compile (cons (list 'import (append imports1 imports2)) rest)))
((('import . imports) . body)
(define compiled-body (ir1->bytecode (expand-body 'main body (make-import-map imports))))
- (encode (link (revappend library-code (list compiled-body)))))
+ (encode (link (revappend library-code (list compiled-body (list (list 'exit (list 'const 0))))))))
(_ (error "unexpected form in compile" program))))))