diff --git a/slither/slithir/convert.py b/slither/slithir/convert.py index 63284db77..101604d55 100644 --- a/slither/slithir/convert.py +++ b/slither/slithir/convert.py @@ -586,6 +586,12 @@ def extract_tmp_call(ins, contract): if isinstance(ins.called, Event): return EventCall(ins.called.name) + if isinstance(ins.called, Contract): + internalcall = InternalCall(ins.called.constructor, ins.nbr_arguments, ins.lvalue, + ins.type_call) + internalcall.call_id = ins.call_id + return internalcall + raise Exception('Not extracted {} {}'.format(type(ins.called), ins)) diff --git a/slither/slithir/tmp_operations/tmp_call.py b/slither/slithir/tmp_operations/tmp_call.py index 0d7fda1e9..3c8faec3c 100644 --- a/slither/slithir/tmp_operations/tmp_call.py +++ b/slither/slithir/tmp_operations/tmp_call.py @@ -1,14 +1,13 @@ -from slither.slithir.operations.lvalue import OperationWithLValue +from slither.core.declarations import Event, Contract, SolidityVariableComposed, SolidityFunction, Structure from slither.core.variables.variable import Variable -from slither.core.declarations.solidity_variables import SolidityVariableComposed, SolidityFunction -from slither.core.declarations.structure import Structure -from slither.core.declarations.event import Event +from slither.slithir.operations.lvalue import OperationWithLValue class TmpCall(OperationWithLValue): def __init__(self, called, nbr_arguments, result, type_call): - assert isinstance(called, (Variable, + assert isinstance(called, (Contract, + Variable, SolidityVariableComposed, SolidityFunction, Structure,