Use initSimContext to create a Crucible SimContext.

This helps to immunize against changes in SimContext... e.g. the
addition on the profilingMetrics field that initSimContext provides a
default value for.
This commit is contained in:
Kevin Quick 2019-01-21 11:40:45 -08:00
parent 86ef62645d
commit f2b98011ce
No known key found for this signature in database
GPG Key ID: E6D7733599CC0A21

View File

@ -658,17 +658,12 @@ runCodeBlock sym archFns archEval halloc (initMem,globs) lookupH g regStruct = d
let macawStructRepr = C.StructRepr crucRegTypes
let ctx :: C.SimContext (MacawSimulatorState sym) sym (MacawExt arch)
ctx = C.SimContext { C._ctxSymInterface = sym
, C.ctxSolverProof = \a -> a
, C.ctxIntrinsicTypes = llvmIntrinsicTypes
, C.simHandleAllocator = halloc
, C.printHandle = stdout
, C.extensionImpl = macawExtensions archEval mvar globs lookupH
, C._functionBindings =
C.insertHandleMap (C.cfgHandle g) (C.UseCFG g (C.postdomInfo g)) $
C.emptyHandleMap
, C._cruciblePersonality = MacawSimulatorState
}
ctx = let fnBindings = C.insertHandleMap (C.cfgHandle g)
(C.UseCFG g (C.postdomInfo g)) $
C.emptyHandleMap
extImpl = macawExtensions archEval mvar globs lookupH
in C.initSimContext sym llvmIntrinsicTypes halloc stdout
fnBindings extImpl MacawSimulatorState
-- Create the symbolic simulator state
let initGlobals = C.insertGlobal mvar initMem C.emptyGlobals
let s = C.InitialState ctx initGlobals C.defaultAbortHandler $