Skip to content

Commit

Permalink
SMT: assume that symbolic addresses cannot be the zero address or pre…
Browse files Browse the repository at this point in the history
…compiles
  • Loading branch information
d-xo committed Sep 11, 2023
1 parent f8a63d9 commit 60f3655
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/EVM/SMT.hs
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,11 @@ declareVars names = SMT2 (["; variables"] <> fmap declare names) cexvars

-- Given a list of variable names, create an SMT2 object with the variables declared
declareAddrs :: [Builder] -> SMT2
declareAddrs names = SMT2 (["; symbolic addresseses"] <> fmap declare names) cexvars
declareAddrs names = SMT2 (["; symbolic addresseses"] <> fmap declare names <> fmap assume names) cexvars
where
declare n = "(declare-const " <> n <> " Addr)"
-- assume that symbolic addresses do not collide with the zero address or precompiles
assume n = "(assert (bvugt " <> n <> " (_ bv9 160)))"
cexvars = (mempty :: CexVars){ addrs = fmap toLazyText names }

declareFrameContext :: [(Builder, [Prop])] -> SMT2
Expand Down

0 comments on commit 60f3655

Please sign in to comment.