Fix incorrect highlevel call lookup

pull/264/head
Josselin 6 years ago
parent a97903836c
commit 00ee4637b8
  1. 10
      slither/slithir/convert.py

@ -781,21 +781,21 @@ def convert_type_of_high_and_internal_level_call(ir, contract):
sigs = get_canonical_names(ir, ir.function_name, ir.contract_name) sigs = get_canonical_names(ir, ir.function_name, ir.contract_name)
for sig in sigs: for sig in sigs:
func = contract.get_function_from_canonical_name(sig) func = contract.get_function_from_canonical_name(sig)
if not func:
func = contract.get_state_variable_from_name(ir.function_name)
if func: if func:
# stop to explore if func is found (prevent dupplicate issue) # stop to explore if func is found (prevent dupplicate issue)
break break
if not func:
func = contract.get_state_variable_from_name(ir.function_name)
else: else:
assert isinstance(ir, HighLevelCall) assert isinstance(ir, HighLevelCall)
sigs = get_sig(ir, ir.function_name) sigs = get_sig(ir, ir.function_name)
for sig in sigs: for sig in sigs:
func = contract.get_function_from_canonical_name(sig) func = contract.get_function_from_signature(sig)
if not func:
func = contract.get_state_variable_from_name(ir.function_name)
if func: if func:
# stop to explore if func is found (prevent dupplicate issue) # stop to explore if func is found (prevent dupplicate issue)
break break
if not func:
func = contract.get_state_variable_from_name(ir.function_name)
if not func: if not func:
# specific lookup when the compiler does implicit conversion # specific lookup when the compiler does implicit conversion
# for example # for example

Loading…
Cancel
Save