Improve constructor call support

pull/293/head
Josselin 5 years ago
parent 8da3b86a30
commit 5b636f5b43
  1. 6
      slither/slithir/convert.py
  2. 9
      slither/slithir/tmp_operations/tmp_call.py

@ -586,6 +586,12 @@ def extract_tmp_call(ins, contract):
if isinstance(ins.called, Event): if isinstance(ins.called, Event):
return EventCall(ins.called.name) 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)) raise Exception('Not extracted {} {}'.format(type(ins.called), ins))

@ -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.variables.variable import Variable
from slither.core.declarations.solidity_variables import SolidityVariableComposed, SolidityFunction from slither.slithir.operations.lvalue import OperationWithLValue
from slither.core.declarations.structure import Structure
from slither.core.declarations.event import Event
class TmpCall(OperationWithLValue): class TmpCall(OperationWithLValue):
def __init__(self, called, nbr_arguments, result, type_call): def __init__(self, called, nbr_arguments, result, type_call):
assert isinstance(called, (Variable, assert isinstance(called, (Contract,
Variable,
SolidityVariableComposed, SolidityVariableComposed,
SolidityFunction, SolidityFunction,
Structure, Structure,

Loading…
Cancel
Save