From 9006ebad1e3a86bf1cb98f20c13dd803078c2f8c Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Wed, 4 Oct 2017 18:07:37 +0700 Subject: [PATCH] Disassembler: prevent duplicate edges --- mythril/disassembler/disassembly.py | 7 +++++-- setup.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mythril/disassembler/disassembly.py b/mythril/disassembler/disassembly.py index 74f631d6..d71989d6 100644 --- a/mythril/disassembler/disassembly.py +++ b/mythril/disassembler/disassembly.py @@ -114,12 +114,15 @@ class Disassembly: 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): diff --git a/setup.py b/setup.py index eb37a056..6eed1354 100755 --- a/setup.py +++ b/setup.py @@ -219,7 +219,7 @@ security community. 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,