diff --git a/src/core/Compile.go b/src/core/Compile.go index 6f8587f..1dedfdc 100644 --- a/src/core/Compile.go +++ b/src/core/Compile.go @@ -92,10 +92,12 @@ func (f *Function) Compile() { f.Assembler.Append(&asm.FunctionEnd{}) } - switch f.Assembler.Instructions[len(f.Assembler.Instructions)-1].(type) { - case *asm.Return: - default: - f.Assembler.Append(&asm.Return{}) + if f.UniqueName != "core.exit" { + switch f.Assembler.Instructions[len(f.Assembler.Instructions)-1].(type) { + case *asm.Return: + default: + f.Assembler.Append(&asm.Return{}) + } } }