From 53455bfed5e7d8c188fbb8393c1b9c41509a2438 Mon Sep 17 00:00:00 2001 From: Mate Soos Date: Mon, 13 Jan 2025 15:44:24 +0100 Subject: [PATCH] Cleaner --- src/EVM.hs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/EVM.hs b/src/EVM.hs index ec057e156..89e0113d9 100644 --- a/src/EVM.hs +++ b/src/EVM.hs @@ -2993,16 +2993,17 @@ instance VMOps Symbolic where assign #result Nothing case (length concVals) of 0 -> continue Nothing - 1 -> runOne (head concVals) - _ -> choose . PleaseChoosePath ewordExpr $ doit concVals + 1 -> runOne $ head concVals + _ -> choose . PleaseChoosePath ewordExpr $ runMore concVals Nothing -> continue Nothing where - doit vals leftOrRight = do - case (length vals) of - 2 -> if leftOrRight then runOne (head vals) + runMore vals leftOrRight = do + case length vals of + -- if 2, we run both, otherwise, we run 1st and run ourselves with the rest + 2 -> if leftOrRight then runOne $ head vals else runOne (head $ tail vals) - _ -> if leftOrRight then runOne (head vals) - else choose . PleaseChoosePath ewordExpr $ doit (tail vals) + _ -> if leftOrRight then runOne $ head vals + else choose . PleaseChoosePath ewordExpr $ runMore (tail vals) runOne val = do assign #result Nothing pushTo #constraints $ Expr.simplifyProp (ewordExpr .== (Lit val))