From c1ae162b5855621e6c4a5634eba0025415d356b9 Mon Sep 17 00:00:00 2001 From: Stephan Stanisic Date: Mon, 18 Nov 2024 07:26:28 +0100 Subject: [PATCH] wip --- src/MiniWasm/Execution.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/MiniWasm/Execution.hs b/src/MiniWasm/Execution.hs index 168fa6d..cd7e221 100644 --- a/src/MiniWasm/Execution.hs +++ b/src/MiniWasm/Execution.hs @@ -169,9 +169,9 @@ step cfg = do a' <- unlabel a b' <- unlabel b - v <- label (labelOf a `lub` labelOf b) $ case (a', b') of - (V_I32 a'', V_I32 b'') -> V_I32 $ evalBinOp op a'' b'' - (V_I64 a'', V_I64 b'') -> V_I64 $ evalBinOp op a'' b'' + v <- label (labelOf a `lub` labelOf b `lub` cfg.progcn) $ case (a', b') of + (V_I32 a'', V_I32 b'') -> V_I32 (evalBinOp op a'' b'') + (V_I64 a'', V_I64 b'') -> V_I64 (evalBinOp op a'' b'') _ -> error "incompatiable binop" return cfg{stack = v : stack, instrs} @@ -179,7 +179,7 @@ step cfg = do a' <- unlabel a b' <- unlabel b - v <- label (labelOf a `lub` labelOf b) $ case (a', b') of + v <- label (labelOf a `lub` labelOf b `lub` cfg.progcn) $ case (a', b') of (V_I32 a'', V_I32 b'') -> boolToI32 (evalRelOp op a'' b'') (V_I64 a'', V_I64 b'') -> boolToI32 (evalRelOp op a'' b'') _ -> error "incompatiable binop" @@ -204,7 +204,7 @@ test2 = do let config = Config [] [] [] [] [Plain $ I32_Const 6, Taint High, Plain $ I32_Const 7, Plain $ I32_BinOp Add] Low stepUntilFinal config -test3 :: LIO Lattice2 (Config Lattice2) +test3 :: LIO Lattice2 (Config Lattice2) test3 = do let config = Config [] [] [] [] [Plain $ I32_Const 6, Taint High, Plain $ I32_Const 7, Plain $ I32_RelOp Lt] Low stepUntilFinal config