Add support of Type for SSA (abi.decode() takes a type as argument)

pull/179/head
Josselin 6 years ago
parent a7cfcf7ae8
commit d6594f2f87
  1. 3
      slither/analyses/data_dependency/data_dependency.py
  2. 4
      slither/slithir/utils/ssa.py

@ -9,6 +9,7 @@ from slither.slithir.variables import (Constant, LocalIRVariable,
ReferenceVariable, ReferenceVariableSSA,
StateIRVariable, TemporaryVariable,
TemporaryVariableSSA, TupleVariableSSA)
from slither.core.solidity_types.type import Type
###################################################################################
###################################################################################
@ -261,7 +262,7 @@ def compute_dependency_function(function):
def convert_variable_to_non_ssa(v):
if isinstance(v, (LocalIRVariable, StateIRVariable, TemporaryVariableSSA, ReferenceVariableSSA, TupleVariableSSA)):
return v.non_ssa_version
assert isinstance(v, (Constant, SolidityVariable, Contract, Enum, SolidityFunction, Structure, Function))
assert isinstance(v, (Constant, SolidityVariable, Contract, Enum, SolidityFunction, Structure, Function, Type))
return v
def convert_to_non_ssa(data_depencies):

@ -4,6 +4,7 @@ from slither.core.cfg.node import NodeType
from slither.core.declarations import (Contract, Enum, Function,
SolidityFunction, SolidityVariable,
SolidityVariableComposed, Structure)
from slither.core.solidity_types.type import Type
from slither.core.variables.local_variable import LocalVariable
from slither.core.variables.state_variable import StateVariable
from slither.slithir.operations import (Assignment, Balance, Binary, Condition,
@ -468,7 +469,8 @@ def get(variable, local_variables_instances, state_variables_instances, temporar
Enum,
SolidityFunction,
Structure,
Function))
Function,
Type)) # type for abi.decode(.., t)
return variable
def get_variable(ir, f, *instances):

Loading…
Cancel
Save