solidity/test/libsolidity/smtCheckerTests/out_of_bounds/array_3.sol

11 lines
316 B
Solidity
Raw Normal View History

2021-03-23 18:15:14 +00:00
pragma experimental SMTChecker;
contract C {
uint[] a;
function r(uint i) public view returns (uint) {
return a[i]; // oob access
}
}
// ----
// Warning 6368: (115-119): CHC: Out of bounds access happens here.\nCounterexample:\na = []\ni = 0\n = 0\n\nTransaction trace:\nC.constructor()\nState: a = []\nC.r(0)