|
|
|
@ -27,6 +27,7 @@ from slither.slithir.operations import ( |
|
|
|
|
BinaryType, |
|
|
|
|
InternalCall, |
|
|
|
|
Index, |
|
|
|
|
InitArray, |
|
|
|
|
) |
|
|
|
|
from slither.slithir.utils.ssa import is_used_later |
|
|
|
|
from slither.slithir.variables import ( |
|
|
|
@ -1059,3 +1060,20 @@ def test_issue_473(): |
|
|
|
|
# return is for second phi |
|
|
|
|
assert len(return_value.values) == 1 |
|
|
|
|
assert second_phi.lvalue in return_value.values |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_issue_1748(): |
|
|
|
|
source = """ |
|
|
|
|
contract Contract { |
|
|
|
|
uint[] arr; |
|
|
|
|
function foo(uint i) public { |
|
|
|
|
arr = [1]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
""" |
|
|
|
|
with slither_from_source(source) as slither: |
|
|
|
|
c = slither.get_contract_from_name("Contract")[0] |
|
|
|
|
f = c.functions[0] |
|
|
|
|
operations = f.slithir_operations |
|
|
|
|
assign_op = operations[0] |
|
|
|
|
assert isinstance(assign_op, InitArray) |
|
|
|
|