forked from ddamchain/solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
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 ethereum#8323 from ethereum/smt_split_3
[SMTChecker] CHC support to internal function calls
- Loading branch information
Showing
67 changed files
with
506 additions
and
189 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
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -14,4 +14,3 @@ contract C | |
} | ||
|
||
// ---- | ||
// Warning: (111-114): Assertion checker does not support recursive function calls. |
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
25 changes: 25 additions & 0 deletions
25
test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_1.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,25 @@ | ||
pragma experimental SMTChecker; | ||
|
||
contract C{ | ||
uint x; | ||
constructor(uint y) public { | ||
assert(x == 0); | ||
x = 1; | ||
} | ||
function f() public { | ||
assert(x == 1); | ||
++x; | ||
g(); | ||
assert(x == 1); | ||
} | ||
|
||
function g() internal { | ||
assert(x == 2); | ||
--x; | ||
assert(x == 1); | ||
} | ||
} | ||
// ---- | ||
// Warning: (70-76): Unused function parameter. Remove or comment out the variable name to silence this warning. | ||
// Warning: (163-166): Overflow (resulting value larger than 2**256 - 1) happens here | ||
// Warning: (245-248): Underflow (resulting value less than 0) happens here |
32 changes: 32 additions & 0 deletions
32
test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_1_fail.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,32 @@ | ||
pragma experimental SMTChecker; | ||
|
||
contract C{ | ||
uint x; | ||
constructor(uint y) public { | ||
assert(x == 1); | ||
x = 1; | ||
} | ||
function f() public { | ||
assert(x == 2); | ||
++x; | ||
g(); | ||
assert(x == 2); | ||
} | ||
|
||
function g() internal { | ||
assert(x == 3); | ||
--x; | ||
assert(x == 2); | ||
} | ||
} | ||
// ---- | ||
// Warning: (70-76): Unused function parameter. Remove or comment out the variable name to silence this warning. | ||
// Warning: (145-159): Assertion violation happens here | ||
// Warning: (163-166): Overflow (resulting value larger than 2**256 - 1) happens here | ||
// Warning: (227-241): Assertion violation happens here | ||
// Warning: (252-266): Assertion violation happens here | ||
// Warning: (177-191): Assertion violation happens here | ||
// Warning: (227-241): Assertion violation happens here | ||
// Warning: (245-248): Underflow (resulting value less than 0) happens here | ||
// Warning: (252-266): Assertion violation happens here | ||
// Warning: (89-103): Assertion violation happens here |
21 changes: 21 additions & 0 deletions
21
test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_inheritance_1.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,21 @@ | ||
pragma experimental SMTChecker; | ||
|
||
contract A { | ||
uint x; | ||
function f() internal { | ||
assert(x == 1); | ||
--x; | ||
} | ||
} | ||
|
||
contract C is A { | ||
constructor() public { | ||
assert(x == 0); | ||
++x; | ||
f(); | ||
assert(x == 0); | ||
} | ||
} | ||
// ---- | ||
// Warning: (100-103): Underflow (resulting value less than 0) happens here | ||
// Warning: (100-103): Underflow (resulting value less than 0) happens here |
26 changes: 26 additions & 0 deletions
26
...libsolidity/smtCheckerTests/functions/internal_call_with_assertion_inheritance_1_fail.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,26 @@ | ||
pragma experimental SMTChecker; | ||
|
||
contract A { | ||
uint x; | ||
function f() internal { | ||
assert(x == 2); | ||
--x; | ||
} | ||
} | ||
|
||
contract C is A { | ||
constructor() public { | ||
assert(x == 1); | ||
++x; | ||
f(); | ||
assert(x == 1); | ||
} | ||
} | ||
// ---- | ||
// Warning: (82-96): Assertion violation happens here | ||
// Warning: (100-103): Underflow (resulting value less than 0) happens here | ||
// Warning: (82-96): Assertion violation happens here | ||
// Warning: (100-103): Underflow (resulting value less than 0) happens here | ||
// Warning: (155-169): Assertion violation happens here | ||
// Warning: (82-96): Assertion violation happens here | ||
// Warning: (187-201): Assertion violation happens here |
Oops, something went wrong.