Merge pull request #11188 from blishko/issue-11181

[SMTChecker] Fix crash when analysing try-catch clauses with function call.
This commit is contained in:
Leonardo
2021-03-31 11:24:36 +02:00
committed by GitHub
6 changed files with 55 additions and 55 deletions
@@ -0,0 +1,13 @@
pragma experimental SMTChecker;
contract C {
function f() public returns (uint) {
try this.f() {
} catch Error(string memory) {
g();
}
}
function g() public pure returns (address) {
}
}
// ----
// Warning 6321: (78-82): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
@@ -0,0 +1,16 @@
pragma experimental SMTChecker;
contract C {
function f() public returns (uint, uint) {
try this.f() {
} catch Error(string memory) {
g();
}
}
function g() public pure {
int test = 1;
}
}
// ----
// Warning 6321: (78-82): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
// Warning 6321: (84-88): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
// Warning 2072: (199-207): Unused local variable.