mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
addressing review comments
This commit is contained in:
@@ -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.
|
||||
Reference in New Issue
Block a user