From bf14716ca7e676fc24f0bdc6b19ba440c9eedd3c Mon Sep 17 00:00:00 2001 From: Pierre Chambart Date: Tue, 29 Nov 2022 19:14:11 +0100 Subject: [PATCH] Repush after br_if --- src/typecheck.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/typecheck.ml b/src/typecheck.ml index 4249cff..fcd8a2e 100644 --- a/src/typecheck.ml +++ b/src/typecheck.ml @@ -341,8 +341,8 @@ let rec typecheck_instr (env : env) (stack : stack) (instr : instr) : stack = | Br_if i -> let stack = Stack.pop [ i32 ] stack in let jt = Env.block_type_get i env in - ignore @@ Stack.pop (List.rev_map typ_of_val_type jt) stack; - stack + let stack = Stack.pop (List.rev_map typ_of_val_type jt) stack in + Stack.push (List.rev_map typ_of_val_type jt) stack | Br_table (branches, i) -> let stack = Stack.pop [ i32 ] stack in let default_jt = Env.block_type_get i env in