forked from ethereum/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#11092 from blishko/issue-10957
[SMTChecker] Resolve current contract context correctly in VariableUsage
- Loading branch information
Showing
6 changed files
with
53 additions
and
4 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
16 changes: 16 additions & 0 deletions
16
test/libsolidity/smtCheckerTests/control_flow/virtual_function_call_inside_branch_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,16 @@ | ||
pragma experimental SMTChecker; | ||
|
||
contract Context {} | ||
|
||
contract ERC20 is Context { | ||
function approve() public virtual { _approve(); } | ||
function _approve() internal virtual {} | ||
} | ||
|
||
contract __unstable__ERC20Owned is ERC20 { | ||
function _approve() internal override { | ||
if (true) { | ||
super._approve(); | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
test/libsolidity/smtCheckerTests/control_flow/virtual_function_call_inside_branch_2.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,23 @@ | ||
pragma experimental SMTChecker; | ||
contract A { | ||
function f() internal virtual { | ||
v(); | ||
} | ||
function v() internal virtual { | ||
} | ||
} | ||
|
||
contract B is A { | ||
function f() internal virtual override { | ||
super.f(); | ||
} | ||
} | ||
|
||
contract C is B { | ||
function v() internal override { | ||
if (0==1) | ||
f(); | ||
} | ||
} | ||
// ---- | ||
// Warning 6838: (303-307): BMC: Condition is always false. |