slither-flat: stop early the exploration if the contract was seen (fix #342)

pull/373/head
Josselin 5 years ago
parent 0ef908e4f5
commit 70cc2a357f
  1. 4
      slither/tools/flattening/flattening.py

@ -93,6 +93,7 @@ class Flattening:
def _export_contract(self, contract, exported, list_contract):
if contract.name in exported:
return
exported.add(contract.name)
for inherited in contract.inheritance:
self._export_contract(inherited, exported, list_contract)
@ -121,9 +122,6 @@ class Flattening:
self._export_contract(ir.contract_created, exported, list_contract)
if isinstance(ir, TypeConversion):
self._export_from_type(ir.type, contract, exported, list_contract)
if contract.name in exported:
return
exported.add(contract.name)
list_contract.append(self._source_codes[contract])
def _export(self, contract, ret):

Loading…
Cancel
Save