-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15701 from ethereum/smt-fix-array-of-strings
SMTChecker: Fix error when initializing fixed-sized-bytes array
- Loading branch information
Showing
3 changed files
with
23 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
test/libsolidity/smtCheckerTests/typecast/fixed_bytes_array_from_strig_inline_array.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
contract D { | ||
function test() public pure { | ||
bytes7[2] memory dummyBytes = [bytes7("A"), "B"]; | ||
assert(uint56(dummyBytes[0]) == 0x41000000000000); | ||
assert(uint56(dummyBytes[1]) == 0x42000000000000); | ||
assert(uint56(dummyBytes[1]) == 0x41000000000000); // Should fail | ||
} | ||
} | ||
// ==== | ||
// SMTEngine: chc | ||
// SMTTargets: assert | ||
// ---- | ||
// Warning 6328: (231-280): CHC: Assertion violation happens here.\nCounterexample:\n\ndummyBytes = [0x41000000000000, 0x42000000000000]\n\nTransaction trace:\nD.constructor()\nD.test() | ||
// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. |