mirror of
https://github.com/GaloisInc/macaw.git
synced 2024-11-29 21:44:11 +03:00
syscall fallthrough in CFG creation
This commit is contained in:
parent
30b54e399a
commit
5cacfec77a
@ -1133,8 +1133,17 @@ addMacawParsedTermStmt blockLabelMap thisAddr tstmt = do
|
||||
let tlbl = parsedBlockLabel blockLabelMap thisAddr (M.stmtsIdent t)
|
||||
let flbl = parsedBlockLabel blockLabelMap thisAddr (M.stmtsIdent f)
|
||||
addTermStmt $! CR.Br crucCond tlbl flbl
|
||||
M.ParsedArchTermStmt aterm regs _mret -> do
|
||||
M.ParsedArchTermStmt aterm regs mnextAddr -> do
|
||||
crucGenArchTermStmt archFns aterm regs
|
||||
case mnextAddr of
|
||||
Just nextAddr -> addTermStmt $ CR.Jump (parsedBlockLabel blockLabelMap nextAddr 0)
|
||||
-- This return () looks innocuous, but is actually pretty bad news.
|
||||
-- CrucGen is a continuation-like monad, originally seeded with a
|
||||
-- continuation that errors out. addTermStmt ignores the
|
||||
-- continuation... but return won't, so this essentially dooms things.
|
||||
-- But what else can we do, if the architecture's discovery process
|
||||
-- doesn't know where code will go next?
|
||||
Nothing -> return ()
|
||||
M.ParsedTranslateError msg -> do
|
||||
msgVal <- crucibleValue (C.TextLit msg)
|
||||
addTermStmt $ CR.ErrorStmt msgVal
|
||||
|
Loading…
Reference in New Issue
Block a user