|
|
@ -1475,15 +1475,15 @@ def convert_constant_types(irs): |
|
|
|
if isinstance(ir.rvalue, TupleVariable): |
|
|
|
if isinstance(ir.rvalue, TupleVariable): |
|
|
|
# TODO: fix missing Unpack conversion |
|
|
|
# TODO: fix missing Unpack conversion |
|
|
|
continue |
|
|
|
continue |
|
|
|
if ir.rvalue.type.type != "int256": |
|
|
|
if ir.rvalue.type.type not in ElementaryTypeInt: |
|
|
|
ir.rvalue.set_type(ElementaryType("int256")) |
|
|
|
ir.rvalue.set_type(ElementaryType(ir.lvalue.type.type)) |
|
|
|
was_changed = True |
|
|
|
was_changed = True |
|
|
|
if isinstance(ir, Binary): |
|
|
|
if isinstance(ir, Binary): |
|
|
|
if isinstance(ir.lvalue.type, ElementaryType): |
|
|
|
if isinstance(ir.lvalue.type, ElementaryType): |
|
|
|
if ir.lvalue.type.type in ElementaryTypeInt: |
|
|
|
if ir.lvalue.type.type in ElementaryTypeInt: |
|
|
|
for r in ir.read: |
|
|
|
for r in ir.read: |
|
|
|
if r.type.type != "int256": |
|
|
|
if r.type.type not in ElementaryTypeInt: |
|
|
|
r.set_type(ElementaryType("int256")) |
|
|
|
r.set_type(ElementaryType(ir.lvalue.type.type)) |
|
|
|
was_changed = True |
|
|
|
was_changed = True |
|
|
|
if isinstance(ir, (HighLevelCall, InternalCall)): |
|
|
|
if isinstance(ir, (HighLevelCall, InternalCall)): |
|
|
|
func = ir.function |
|
|
|
func = ir.function |
|
|
@ -1498,8 +1498,8 @@ def convert_constant_types(irs): |
|
|
|
t = types[idx] |
|
|
|
t = types[idx] |
|
|
|
if isinstance(t, ElementaryType): |
|
|
|
if isinstance(t, ElementaryType): |
|
|
|
if t.type in ElementaryTypeInt: |
|
|
|
if t.type in ElementaryTypeInt: |
|
|
|
if arg.type.type != "int256": |
|
|
|
if arg.type.type not in ElementaryTypeInt: |
|
|
|
arg.set_type(ElementaryType("int256")) |
|
|
|
arg.set_type(ElementaryType(t.type)) |
|
|
|
was_changed = True |
|
|
|
was_changed = True |
|
|
|
if isinstance(ir, NewStructure): |
|
|
|
if isinstance(ir, NewStructure): |
|
|
|
st = ir.structure |
|
|
|
st = ir.structure |
|
|
@ -1507,16 +1507,16 @@ def convert_constant_types(irs): |
|
|
|
e = st.elems_ordered[idx] |
|
|
|
e = st.elems_ordered[idx] |
|
|
|
if isinstance(e.type, ElementaryType): |
|
|
|
if isinstance(e.type, ElementaryType): |
|
|
|
if e.type.type in ElementaryTypeInt: |
|
|
|
if e.type.type in ElementaryTypeInt: |
|
|
|
if arg.type.type != "int256": |
|
|
|
if arg.type.type not in ElementaryTypeInt: |
|
|
|
arg.set_type(ElementaryType("int256")) |
|
|
|
arg.set_type(ElementaryType(e.type.type)) |
|
|
|
was_changed = True |
|
|
|
was_changed = True |
|
|
|
if isinstance(ir, InitArray): |
|
|
|
if isinstance(ir, InitArray): |
|
|
|
if isinstance(ir.lvalue.type, ArrayType): |
|
|
|
if isinstance(ir.lvalue.type, ArrayType): |
|
|
|
if isinstance(ir.lvalue.type.type, ElementaryType): |
|
|
|
if isinstance(ir.lvalue.type.type, ElementaryType): |
|
|
|
if ir.lvalue.type.type.type in ElementaryTypeInt: |
|
|
|
if ir.lvalue.type.type.type in ElementaryTypeInt: |
|
|
|
for r in ir.read: |
|
|
|
for r in ir.read: |
|
|
|
if r.type.type != "int256": |
|
|
|
if r.type.type not in ElementaryTypeInt: |
|
|
|
r.set_type(ElementaryType("int256")) |
|
|
|
r.set_type(ElementaryType(ir.lvalue.type.type.type)) |
|
|
|
was_changed = True |
|
|
|
was_changed = True |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|