Skip to content

Commit

Permalink
Update llvm-pretty and llvm-pretty-bc-parser submodules (#333)
Browse files Browse the repository at this point in the history
* Update llvm-pretty and llvm-pretty-bc-parser submodules

* Update crucible submodule to track llvm-pretty* changes

* Changes for updated Crucible submodule

- TimeoutResult from symbolic simulator
- New X86_FP80 type

* Update llvm-verifier submodule to account for llvm-pretty* changes
  • Loading branch information
langston-barrett authored Dec 15, 2018
1 parent 217893c commit bbbb4ad
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion deps/llvm-pretty
2 changes: 1 addition & 1 deletion deps/llvm-verifier
2 changes: 1 addition & 1 deletion saw-script.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ library
, jvm-parser
, jvm-verifier
, lens
, llvm-pretty >= 0.5
, llvm-pretty >= 0.8
, llvm-pretty-bc-parser >= 0.1.3.1
, llvm-verifier >= 0.2.1
, monad-supply
Expand Down
22 changes: 15 additions & 7 deletions src/SAWScript/CrucibleBuiltins.hs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,13 @@ crucible_llvm_verify bic opts lm nm lemmas checkSat setup tactic =
setupLoc <- toW4Loc "_SAW_verify_prestate" <$> getPosition

def <- case find (\d -> L.defName d == nm') (L.modDefines llmod) of
Nothing -> fail ("Could not find function named" ++ show nm)
Just decl -> return decl
Just decl -> return decl
Nothing -> fail $ unlines $
[ "Could not find function named " ++ show nm
] ++ if simVerbose opts < 3
then [ "Run SAW with --sim-verbose=3 to see all function names" ]
else "Available function names:" :
map ((" " ++) . show . L.defName) (L.modDefines llmod)
st0 <- either (fail . show . ppSetupError) return (initialCrucibleSetupState cc def setupLoc)

-- execute commands of the method spec
Expand All @@ -185,7 +190,7 @@ crucible_llvm_verify bic opts lm nm lemmas checkSat setup tactic =
let globals = cc^.ccLLVMGlobals
let mvar = Crucible.llvmMemVar (cc^.ccLLVMContext)
mem0 <- case Crucible.lookupGlobal mvar globals of
Nothing -> fail "internal error: LLVM Memory global not found"
Nothing -> fail "internal error: LLVM Memory global not found"
Just mem0 -> return mem0
let globals1 = Crucible.llvmGlobals (cc^.ccLLVMContext) mem0

Expand Down Expand Up @@ -1038,10 +1043,13 @@ constructExpandedSetupValue sc loc t =
Crucible.ArrayType n memTy ->
SetupArray <$> replicateM n (constructExpandedSetupValue sc loc memTy)

Crucible.FloatType -> fail "crucible_fresh_expanded_var: Float not supported"
Crucible.DoubleType -> fail "crucible_fresh_expanded_var: Double not supported"
Crucible.MetadataType -> fail "crucible_fresh_expanded_var: Metadata not supported"
Crucible.VecType{} -> fail "crucible_fresh_expanded_var: Vec not supported"
Crucible.FloatType -> failUnsupportedType "Float"
Crucible.DoubleType -> failUnsupportedType "Double"
Crucible.MetadataType -> failUnsupportedType "Metadata"
Crucible.VecType{} -> failUnsupportedType "Vec"
Crucible.X86_FP80Type{} -> failUnsupportedType "X86_FP80"
where failUnsupportedType tyName = fail $ unwords
["crucible_fresh_expanded_var: " ++ tyName ++ " not supported"]

llvmTypeAlias :: L.Type -> Maybe Crucible.Ident
llvmTypeAlias (L.Alias i) = Just i
Expand Down
4 changes: 3 additions & 1 deletion src/SAWScript/CrucibleBuiltinsJVM.hs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ crucible_java_extract bic opts c mname = do

res <- CJ.runMethodHandle sym CrucibleSAW.SAWCruciblePersonality halloc
ctx verbosity className h args

case res of
Crucible.FinishedResult _ pr -> do
gp <- getGlobalPair opts pr
Expand All @@ -175,3 +175,5 @@ crucible_java_extract bic opts c mname = do
mkTypedTerm sc t'
Crucible.AbortedResult _ _ar -> do
fail $ unlines [ "Symbolic execution failed." ]
Crucible.TimeoutResult _cxt -> do
fail $ unlines [ "Symbolic execution timed out." ]
2 changes: 2 additions & 0 deletions src/SAWScript/X86.hs
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ doSim opts elf sfs name (globs,overs) st =
malformed $ unlines [ "Failed to finish execution"
, ppAbort mvar res
]
TimeoutResult _ctx ->
malformed $ unlines [ "Execution timed out" ]

mem <- getMem gp mvar
return ( addrInt
Expand Down

0 comments on commit bbbb4ad

Please sign in to comment.