From d34570afc15aefc05b0bea47973972b894669eb6 Mon Sep 17 00:00:00 2001 From: David Pokora Date: Wed, 8 May 2019 03:40:08 -0400 Subject: [PATCH] Updated shadowing-local to output events as events, instead of functions. --- slither/detectors/shadowing/local.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/slither/detectors/shadowing/local.py b/slither/detectors/shadowing/local.py index 0a04ebed7..0c9e830dd 100644 --- a/slither/detectors/shadowing/local.py +++ b/slither/detectors/shadowing/local.py @@ -42,7 +42,6 @@ contract Bug { WIKI_RECOMMENDATION = 'Rename the local variable so as not to mistakenly overshadow any state variable/function/modifier/event definitions.' - OVERSHADOWED_FUNCTION = "function" OVERSHADOWED_MODIFIER = "modifier" OVERSHADOWED_STATE_VARIABLE = "state variable" @@ -116,14 +115,14 @@ contract Bug { overshadowed_entry[0], overshadowed_entry[2].source_mapping_str) - # Generate relevant JSON data for this shadowing definition. json = self.generate_json_result(info) self.add_variable_to_json(local_variable, json) for overshadowed_entry in overshadowed: - if overshadowed_entry[0] in [self.OVERSHADOWED_FUNCTION, self.OVERSHADOWED_MODIFIER, - self.OVERSHADOWED_EVENT]: + if overshadowed_entry[0] in [self.OVERSHADOWED_FUNCTION, self.OVERSHADOWED_MODIFIER]: self.add_function_to_json(overshadowed_entry[2], json) + elif overshadowed_entry[0] == self.OVERSHADOWED_EVENT: + self.add_event_to_json(overshadowed_entry[2], json) elif overshadowed_entry[0] == self.OVERSHADOWED_STATE_VARIABLE: self.add_variable_to_json(overshadowed_entry[2], json) results.append(json)