From 843ba8b034d8c59125794b97cb1983ad3dd8423a Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 23 Dec 2022 06:40:40 +0100 Subject: [PATCH] fix inline fn args not removed from stack --- compiler.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler.ml b/compiler.ml index e13063e..b478c3b 100644 --- a/compiler.ml +++ b/compiler.ml @@ -30,10 +30,10 @@ let rec compile_expr env = function args in List.flatten ca - @ - if Env.mem f Baselib.builtins - then Env.find f Baselib.builtins - else [ Jal (puf ^ f); Addi (SP, SP, 4 * List.length args) ] + @ (if Env.mem f Baselib.builtins + then Env.find f Baselib.builtins + else [ Jal (puf ^ f) ]) + @ [ Addi (SP, SP, 4 * List.length args) ] ;; let rec compile_instr info = function