mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[SMTChecker] Clear state knowledge after external function calls
This commit is contained in:
@@ -9,5 +9,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (99-107): Assertion checker does not yet implement this type of function call.
|
||||
// Warning: (141-144): Assertion checker does not support recursive function calls.
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract D
|
||||
{
|
||||
function g(uint x) public;
|
||||
}
|
||||
|
||||
contract C
|
||||
{
|
||||
uint x;
|
||||
function f(uint y, D d) public {
|
||||
require(x == y);
|
||||
assert(x == y);
|
||||
d.g(y);
|
||||
// Storage knowledge is cleared after an external call.
|
||||
assert(x == y);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (119-122): Assertion checker does not yet support the type of this variable.
|
||||
// Warning: (240-254): Assertion violation happens here
|
||||
@@ -0,0 +1,21 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract D
|
||||
{
|
||||
function g(uint x) public;
|
||||
}
|
||||
|
||||
contract C
|
||||
{
|
||||
mapping (uint => uint) map;
|
||||
function f(uint y, D d) public {
|
||||
require(map[0] == map[1]);
|
||||
assert(map[0] == map[1]);
|
||||
d.g(y);
|
||||
// Storage knowledge is cleared after an external call.
|
||||
assert(map[0] == map[1]);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (139-142): Assertion checker does not yet support the type of this variable.
|
||||
// Warning: (280-304): Assertion violation happens here
|
||||
@@ -0,0 +1,22 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract D
|
||||
{
|
||||
function g(uint x) public;
|
||||
}
|
||||
|
||||
contract C
|
||||
{
|
||||
mapping (uint => uint) storageMap;
|
||||
function f(uint y, D d) public {
|
||||
mapping (uint => uint) storage map = storageMap;
|
||||
require(map[0] == map[1]);
|
||||
assert(map[0] == map[1]);
|
||||
d.g(y);
|
||||
// Storage knowledge is cleared after an external call.
|
||||
assert(map[0] == map[1]);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (146-149): Assertion checker does not yet support the type of this variable.
|
||||
// Warning: (338-362): Assertion violation happens here
|
||||
Reference in New Issue
Block a user