From 30736c9f67f166a9d4f26fc68f69d4ae3221c0af Mon Sep 17 00:00:00 2001 From: Josselin Date: Wed, 8 May 2019 12:05:57 +0100 Subject: [PATCH] Fix incorrect function lookup in case of shadowing --- slither/slithir/convert.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/slither/slithir/convert.py b/slither/slithir/convert.py index 5208e4641..f1e0a84ed 100644 --- a/slither/slithir/convert.py +++ b/slither/slithir/convert.py @@ -678,6 +678,9 @@ def convert_type_library_call(ir, lib_contract): func = lib_contract.get_function_from_signature(sig) if not func: func = lib_contract.get_state_variable_from_name(ir.function_name) + if func: + # stop to explore if func is found (prevent dupplicate issue) + break # In case of multiple binding to the same type if not func: # specific lookup when the compiler does implicit conversion @@ -712,6 +715,9 @@ def convert_type_of_high_and_internal_level_call(ir, contract): func = contract.get_function_from_signature(sig) if not func: func = contract.get_state_variable_from_name(ir.function_name) + if func: + # stop to explore if func is found (prevent dupplicate issue) + break if not func: # specific lookup when the compiler does implicit conversion # for example