Skip to content

Commit

Permalink
Prevent dupplicate results for unini local var detector
Browse files Browse the repository at this point in the history
  • Loading branch information
montyly committed Dec 14, 2018
1 parent f4ecee0 commit 3fb066d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions slither/detectors/variables/uninitialized_local_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ def detect(self):

for contract in self.slither.contracts:
for function in contract.functions:
if function.is_implemented:
if function.is_implemented and function.contract == contract:
if function.contains_assembly:
continue
# dont consider storage variable, as they are detected by another detector
uninitialized_local_variables = [v for v in function.local_variables if not v.is_storage and v.uninitialized]
function.entry_point.context[self.key] = uninitialized_local_variables
self._detect_uninitialized(function, function.entry_point, [])

for(function, uninitialized_local_variable) in self.results:
all_results = list(set(self.results))
for(function, uninitialized_local_variable) in all_results:
var_name = uninitialized_local_variable.name

info = "{} in {}.{} ({}) is a local variable never initialiazed\n"
Expand Down

0 comments on commit 3fb066d

Please sign in to comment.