Skip to content

Commit

Permalink
Disassembler: prevent duplicate edges
Browse files Browse the repository at this point in the history
  • Loading branch information
muellerberndt committed Oct 4, 2017
1 parent 0a4b8dc commit 9006eba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions mythril/disassembler/disassembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,15 @@ def __init__(self, code):
except IndexError:
continue

self.xrefs.append((block.id, self.blocks[j].id))

if not (block.id, self.blocks[j].id) in self.xrefs:
self.xrefs.append((block.id, self.blocks[j].id))

# if the last instruction isn't an unconditional jump or halt, also add a reference to the following block

if (block.id < len(self.blocks)) and (block.instruction_list[block.length - 1]['opcode'] not in ['JUMP', 'STOP', 'THROW', 'REVERT', 'INVALID']):
self.xrefs.append((block.id, block.id + 1))
if not (block.id, self.blocks[j].id) in self.xrefs:
self.xrefs.append((block.id, block.id + 1))


def get_easm(self):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
setup(
name='mythril',

version='0.3.8',
version='0.3.9',

description='A reversing and bug hunting framework for the Ethereum blockchain',
long_description=long_description,
Expand Down

0 comments on commit 9006eba

Please sign in to comment.