summaryrefslogtreecommitdiff
path: root/python/basicblock.py
diff options
context:
space:
mode:
authorrollsafe <rollsafe@users.noreply.github.com>2019-07-02 18:28:13 -0400
committerrollsafe <rollsafe@users.noreply.github.com>2019-07-02 18:28:13 -0400
commitf95a3e4baabc1c74cfb5a8c6b33f4a2a7ff91841 (patch)
tree76dade760d6d7a9784af308c2dd59c44a641c9e7 /python/basicblock.py
parent45b0e3c0c0377d77e3c894e523ec33124a2f0f3e (diff)
Fix infinite loop for basic blocks with invalid instructions
Diffstat (limited to 'python/basicblock.py')
-rw-r--r--python/basicblock.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/python/basicblock.py b/python/basicblock.py
index 4a451a38..98a7b212 100644
--- a/python/basicblock.py
+++ b/python/basicblock.py
@@ -176,6 +176,8 @@ class BasicBlock(object):
start = self.start
while start < self.end:
length = self.view.get_instruction_length(start)
+ if length == 0: # invalid instruction. avoid infinite loop
+ break
self._instLengths.append(length)
self._instStarts.append(start)
start += length