From 762431b0f0a6ead18a93a05c0f3269dca5b8fef1 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Fri, 29 Jul 2022 17:52:54 -0700 Subject: Insert an exit op at the end of the program. --- csc/compiler.csc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'csc/compiler.csc') 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)))))) -- cgit v1.3.1