add bug revealing test for #1748

pull/1761/head
William Aaron Cheung 2 years ago
parent 64b2e0c063
commit 547a8047f0
No known key found for this signature in database
GPG Key ID: CAE0CC3F73B5EA93
  1. 18
      tests/test_ssa_generation.py

@ -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)

Loading…
Cancel
Save