mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #11188 from blishko/issue-11181
[SMTChecker] Fix crash when analysing try-catch clauses with function call.
This commit is contained in:
@@ -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.
|
||||
Reference in New Issue
Block a user