mirror of
https://github.com/GaloisInc/macaw.git
synced 2024-11-27 03:13:43 +03:00
[arm] Fail disassembly if readInstruction returns 0 bytes consumed
Without this check this condition could cause the disassembly to recurse until all system memory is exhausted.
This commit is contained in:
parent
80886bd73d
commit
9e0c325400
@ -134,6 +134,7 @@ disassembleBlock lookupSemantics mem gs curPCAddr maxOffset = do
|
||||
let off = MM.msegOffset curPCAddr
|
||||
case readInstruction mem curPCAddr of
|
||||
Left err -> failAt gs off curPCAddr (DecodeError err)
|
||||
Right (_, 0) -> failAt gs off curPCAddr (InvalidNextPC curPCAddr curPCAddr)
|
||||
Right (i, bytesRead) -> do
|
||||
-- traceM ("II: " ++ show i)
|
||||
let nextPCOffset = off + bytesRead
|
||||
|
Loading…
Reference in New Issue
Block a user