diff --git a/mythril/analysis/symbolic.py b/mythril/analysis/symbolic.py index 1626607e..09b00b87 100644 --- a/mythril/analysis/symbolic.py +++ b/mythril/analysis/symbolic.py @@ -103,6 +103,8 @@ class SymExecWrapper: hex(ATTACKER_ADDRESS): attacker_account, } + instruction_laser_plugin = PluginFactory.build_instruction_coverage_plugin() + self.laser = svm.LaserEVM( dynamic_loader=dynloader, max_depth=max_depth, @@ -113,6 +115,7 @@ class SymExecWrapper: requires_statespace=requires_statespace, enable_iprof=enable_iprof, enable_coverage_strategy=enable_coverage_strategy, + instruction_laser_plugin=instruction_laser_plugin, ) if loop_bound is not None: diff --git a/mythril/laser/ethereum/svm.py b/mythril/laser/ethereum/svm.py index 42e00ab8..c5d5c68e 100644 --- a/mythril/laser/ethereum/svm.py +++ b/mythril/laser/ethereum/svm.py @@ -56,6 +56,7 @@ class LaserEVM: requires_statespace=True, enable_iprof=False, enable_coverage_strategy=False, + instruction_laser_plugin=None, ) -> None: """ Initializes the laser evm object @@ -104,16 +105,11 @@ class LaserEVM: self.iprof = InstructionProfiler() if enable_iprof else None if enable_coverage_strategy: - from mythril.laser.ethereum.plugins.implementations.coverage.coverage_plugin import ( - InstructionCoveragePlugin, - ) from mythril.laser.ethereum.plugins.implementations.coverage.coverage_strategy import ( CoverageStrategy, ) - instruction = InstructionCoveragePlugin() - instruction.initialize(self) - self.strategy = CoverageStrategy(self.strategy, instruction) + self.strategy = CoverageStrategy(self.strategy, instruction_laser_plugin) log.info("LASER EVM initialized with dynamic loader: " + str(dynamic_loader))