solidity/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_bytes.sol

25 lines
571 B
Solidity
Raw Normal View History

contract C {
bytes b;
function f() public {
require(b.length == 0);
2020-12-15 18:49:57 +00:00
b.push() = bytes1(uint8(1));
assert(b[0] == bytes1(uint8(1)));
}
function g() public {
2020-12-15 18:49:57 +00:00
bytes1 one = bytes1(uint8(1));
b.push() = one;
assert(b[b.length - 1] == one);
// Fails
2020-12-15 18:49:57 +00:00
assert(b[b.length - 1] == bytes1(uint8(100)));
}
}
2021-03-31 15:11:54 +00:00
// ====
// SMTEngine: all
2022-05-04 14:29:50 +00:00
// SMTIgnoreCex: yes
// ----
2022-05-04 14:29:50 +00:00
// Warning 6328: (265-310): CHC: Assertion violation happens here.
2023-02-09 16:07:13 +00:00
// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.