addressing review comments

This commit is contained in:
Martin Blicha
2021-01-11 14:19:06 +01:00
parent 3d7188ac7b
commit ff76c989ac
5 changed files with 53 additions and 25 deletions
@@ -23,6 +23,8 @@ contract C {
}
}
}
// ====
// SMTIgnoreCex: yes
// ----
// Warning 6328: (211-225): CHC: Assertion violation happens here.\nCounterexample:\nx = (- 1), d = 0\n\n\n\nTransaction trace:\nC.constructor()\nState: x = 0, d = 0\nC.f()
// Warning 6328: (351-365): CHC: Assertion violation happens here.\nCounterexample:\nx = 0, d = 0\n\n\n\nTransaction trace:\nC.constructor()\nState: x = 0, d = 0\nC.f()
// Warning 6328: (211-225): CHC: Assertion violation happens here.
// Warning 6328: (351-365): CHC: Assertion violation happens here.
@@ -0,0 +1,17 @@
pragma experimental SMTChecker;
contract C {
function g() public pure returns (bytes memory) {
return hex"ffff";
}
function f() public view {
try this.g() returns (bytes memory b) {
assert(b[0] == bytes1(uint8(255)) && b[1] == bytes1(uint8(255))); // should hold
assert(b[0] == bytes1(uint8(0)) || b[1] == bytes1(uint8(0))); // should fail
} catch {
}
}
}
// ----
// Warning 6328: (278-338): CHC: Assertion violation happens here.\nCounterexample:\n\n\n\n\nTransaction trace:\nC.constructor()\nC.f()
@@ -0,0 +1,17 @@
pragma experimental SMTChecker;
contract C {
function g() public pure returns (bytes2) {
return hex"ffff";
}
function f() public view {
try this.g() returns (bytes2 b) {
assert(uint8(b[0]) == 255 && uint8(b[1]) == 255); // should hold
assert(uint8(b[0]) == 0 || uint8(b[1]) == 0); // should fail
} catch {
}
}
}
// ----
// Warning 6328: (250-294): CHC: Assertion violation happens here.