Skip to content

Commit

Permalink
Update and adapt to GaloisInc/macaw#230.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Huffman committed Oct 27, 2021
1 parent 2bbe28d commit 6d31d53
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/SAWScript/Crucible/LLVM/X86.hs
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,12 @@ llvm_verify_x86 (Some (llvmModule :: LLVMModule x)) path nm globsyms checkSat se
[ "Unable to find CFG for function at address "
, show $ W4.ppExpr off
]
archEvalFns = Macaw.x86_64MacawEvalFn sfs Macaw.defaultMacawArchStmtExtensionOverride
lookupSyscall = Macaw.unsupportedSyscalls "saw-script"
noExtraValidityPred _ _ _ _ = return Nothing
defaultMacawExtensions_x86_64 = Macaw.macawExtensions
(Macaw.x86_64MacawEvalFn sfs) mvar
defaultMacawExtensions_x86_64 =
Macaw.macawExtensions
archEvalFns mvar
(mkGlobalMap . Map.singleton 0 $ preState ^. x86GlobalBase)
funcLookup
lookupSyscall
Expand Down
4 changes: 3 additions & 1 deletion src/SAWScript/X86.hs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ import Data.Macaw.Symbolic( ArchRegStruct
, MacawSimulatorState(..)
, macawExtensions
, unsupportedSyscalls
, defaultMacawArchStmtExtensionOverride
)
import qualified Data.Macaw.Symbolic as Macaw ( LookupFunctionHandle(..) )
import Data.Macaw.Symbolic( MacawExt
Expand Down Expand Up @@ -474,14 +475,15 @@ doSim opts elf sfs name (globs,overs) st checkPost =
-- The memory setup for this verifier does not have that problem, and
-- thus does not need any additional validity predicates.
let noExtraValidityPred _ _ _ _ = return Nothing
let archEvalFns = x86_64MacawEvalFn sfs defaultMacawArchStmtExtensionOverride
let lookupSyscall = unsupportedSyscalls "saw-script"
let ctx :: SimContext (MacawSimulatorState Sym) Sym (MacawExt X86_64)
ctx = SimContext { _ctxSymInterface = sym
, ctxSolverProof = \a -> a
, ctxIntrinsicTypes = llvmIntrinsicTypes
, simHandleAllocator = allocator opts
, printHandle = stdout
, extensionImpl = macawExtensions (x86_64MacawEvalFn sfs) mvar globs (callHandler overs sym) lookupSyscall noExtraValidityPred
, extensionImpl = macawExtensions archEvalFns mvar globs (callHandler overs sym) lookupSyscall noExtraValidityPred
, _functionBindings = FnBindings $
insertHandleMap (cfgHandle cfg) (UseCFG cfg (postdomInfo cfg)) emptyHandleMap
, _cruciblePersonality = MacawSimulatorState
Expand Down

0 comments on commit 6d31d53

Please sign in to comment.