From 39d1b40f068931c61c44ddb09afe9e76f25fff21 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 11 Jun 2019 18:23:03 +0200 Subject: [PATCH] Update --- .../plugins/implementations/dependency_pruner.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/mythril/laser/ethereum/plugins/implementations/dependency_pruner.py b/mythril/laser/ethereum/plugins/implementations/dependency_pruner.py index 97976bbd..be1d5fe0 100644 --- a/mythril/laser/ethereum/plugins/implementations/dependency_pruner.py +++ b/mythril/laser/ethereum/plugins/implementations/dependency_pruner.py @@ -63,7 +63,6 @@ class DependencyPruner(LaserPlugin): """Creates DependencyPruner""" self.iteration = 0 self.dependency_map = {} # type: Dict[int, List] - self.jumpdests_seen = [] # type: int def _reset(self): """TODO: Reset this plugin""" @@ -92,16 +91,7 @@ class DependencyPruner(LaserPlugin): return if address not in self.dependency_map: - if address in self.jumpdests_seen: - logging.info("Skipping known path with no state dependencies") - raise PluginSkipState - else: - self.jumpdests_seen.append(address) - logging.info("New basic block discovered: {}".format(address)) - # This is a new path - return - - self.jumpdests_seen.append(address) + return if not set(annotation.storage_written).intersection( set(self.dependency_map[address]) @@ -118,7 +108,9 @@ class DependencyPruner(LaserPlugin): @symbolic_vm.pre_hook("SSTORE") def mutator_hook(state: GlobalState): annotation = get_dependency_annotation(state) - annotation.storage_written.append(state.mstate.stack[-1]) + + logging.info("SSTORE: Write storage {}".format(state.mstate.stack[-1])) + annotation.storage_written = list( set(annotation.storage_written + [state.mstate.stack[-1]]) )