2020-12-14 10:54:54 +00:00
|
|
|
pragma experimental SMTChecker;
|
|
|
|
|
|
|
|
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)));
|
2020-12-14 10:54:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function g() public {
|
2020-12-15 18:49:57 +00:00
|
|
|
bytes1 one = bytes1(uint8(1));
|
2020-12-14 10:54:54 +00:00
|
|
|
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)));
|
2020-12-14 10:54:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
// ----
|
2021-01-06 15:06:15 +00:00
|
|
|
// Warning 6328: (298-343): CHC: Assertion violation happens here.\nCounterexample:\nb = [1]\n\nTransaction trace:\nC.constructor()\nState: b = []\nC.g()
|