2021-03-23 18:15:14 +00:00
|
|
|
contract C {
|
|
|
|
uint[] a;
|
|
|
|
uint l;
|
|
|
|
function p() public {
|
|
|
|
require(a.length < type(uint).max - 1);
|
|
|
|
a.push();
|
|
|
|
++l;
|
|
|
|
}
|
|
|
|
function q() public {
|
|
|
|
require(a.length > 0);
|
|
|
|
a.pop();
|
|
|
|
--l;
|
|
|
|
}
|
|
|
|
function r() public view returns (uint) {
|
|
|
|
require(l > 0);
|
|
|
|
return a[l]; // oob access
|
|
|
|
}
|
|
|
|
}
|
2021-03-31 15:11:54 +00:00
|
|
|
// ====
|
|
|
|
// SMTEngine: all
|
2021-10-06 09:53:03 +00:00
|
|
|
// SMTIgnoreOS: macos
|
2021-03-23 18:15:14 +00:00
|
|
|
// ----
|
2021-03-31 15:11:54 +00:00
|
|
|
// Warning 4984: (112-115): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
|
2022-08-26 12:33:59 +00:00
|
|
|
// Warning 3944: (181-184): CHC: Underflow (resulting value less than 0) might happen here.
|
2023-01-19 13:06:23 +00:00
|
|
|
// Warning 6368: (259-263): CHC: Out of bounds access happens here.
|
2023-02-09 16:07:13 +00:00
|
|
|
// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.
|
2021-03-31 15:11:54 +00:00
|
|
|
// Warning 2661: (112-115): BMC: Overflow (resulting value larger than 2**256 - 1) happens here.
|
2022-08-26 12:33:59 +00:00
|
|
|
// Warning 4144: (181-184): BMC: Underflow (resulting value less than 0) happens here.
|