solidity/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_3.sol
2021-03-30 10:28:48 +02:00

16 lines
307 B
Solidity

pragma experimental SMTChecker;
contract C {
uint[][] a;
function p() public { a.push(); }
function q(uint i) public {
require(i < a.length);
a[i].push();
}
function r() public view {
for (uint i = 0; i < a.length; ++i)
for (uint j = 0; j < a[i].length; ++j)
a[i][j]; // safe access
}
}