Merge pull request #7851 from ethereum/smt_fix_function_type

[SMTChecker] Fix ICE for arrays and mappings of functions.
This commit is contained in:
Leonardo
2019-11-30 13:15:08 +01:00
committed by GitHub
7 changed files with 48 additions and 2 deletions
@@ -0,0 +1,5 @@
pragma experimental SMTChecker;
library L {
struct Nested { uint y; }
function c(function(Nested memory) external returns (uint)[] storage) external pure {}
}
@@ -0,0 +1,9 @@
pragma experimental SMTChecker;
contract C {
struct Nested { uint y; }
// ensure that we consider array of function pointers as reference type
function b(function(Nested memory) external returns (uint)[] storage) internal pure {}
function c(function(Nested memory) external returns (uint)[] memory) public pure {}
function d(function(Nested memory) external returns (uint)[] calldata) external pure {}
}
// ----
@@ -0,0 +1,14 @@
pragma experimental SMTChecker;
contract C {
function(uint) external returns (uint)[] public x;
function(uint) internal returns (uint)[10] y;
function f() view public {
function(uint) returns (uint)[10] memory a;
function(uint) returns (uint)[10] storage b = y;
function(uint) external returns (uint)[] memory c;
c = new function(uint) external returns (uint)[](200);
a; b;
}
}
// ----
// Warning: (361-410): Assertion checker does not yet implement this type of function call.
@@ -0,0 +1,7 @@
pragma experimental SMTChecker;
contract test {
mapping (address => function() internal returns (uint)) a;
mapping (address => function() external) b;
mapping (address => function() external[]) c;
function() external[] d;
}