|
|
|
@ -10,6 +10,7 @@ from slither.core.solidity_types import (ArrayType, ElementaryType, |
|
|
|
|
from slither.core.solidity_types.elementary_type import Int as ElementaryTypeInt |
|
|
|
|
from slither.core.variables.variable import Variable |
|
|
|
|
from slither.core.variables.state_variable import StateVariable |
|
|
|
|
from slither.slithir.variables import TupleVariable |
|
|
|
|
from slither.slithir.operations import (Assignment, Balance, Binary, |
|
|
|
|
BinaryType, Call, Condition, Delete, |
|
|
|
|
EventCall, HighLevelCall, Index, |
|
|
|
@ -852,6 +853,12 @@ def convert_constant_types(irs): |
|
|
|
|
if isinstance(ir, Assignment): |
|
|
|
|
if isinstance(ir.lvalue.type, ElementaryType): |
|
|
|
|
if ir.lvalue.type.type in ElementaryTypeInt: |
|
|
|
|
if isinstance(ir.rvalue, Function): |
|
|
|
|
continue |
|
|
|
|
elif isinstance(ir.rvalue, TupleVariable): |
|
|
|
|
# TODO: fix missing Unpack conversion |
|
|
|
|
continue |
|
|
|
|
else: |
|
|
|
|
if ir.rvalue.type.type != 'int256': |
|
|
|
|
ir.rvalue.set_type(ElementaryType('int256')) |
|
|
|
|
was_changed = True |
|
|
|
|