2019-02-21 12:01:58 +00:00
|
|
|
pragma experimental SMTChecker;
|
|
|
|
|
|
|
|
contract C
|
|
|
|
{
|
|
|
|
mapping (uint => uint) a;
|
|
|
|
mapping (uint => mapping (uint => uint)) maps;
|
|
|
|
mapping (uint => mapping (uint => uint8)) maps8;
|
|
|
|
function f(mapping (uint => uint) storage map1, mapping (uint => uint) storage map2) internal {
|
2020-02-12 02:21:42 +00:00
|
|
|
map1[0] = 2;
|
|
|
|
a[0] = 42;
|
|
|
|
maps[0][0] = 42;
|
|
|
|
maps8[0][0] = 42;
|
2019-02-21 12:01:58 +00:00
|
|
|
map2[0] = 1;
|
|
|
|
// Fails because map2 == map1 is possible.
|
|
|
|
assert(map1[0] == 2);
|
|
|
|
// Fails because map2 == a is possible.
|
|
|
|
assert(a[0] == 42);
|
|
|
|
// Fails because map2 == maps[0] is possible.
|
|
|
|
assert(maps[0][0] == 42);
|
|
|
|
// Should not fail since knowledge is erased only for mapping (uint => uint).
|
|
|
|
assert(maps8[0][0] == 42);
|
|
|
|
assert(map2[0] == 1);
|
|
|
|
}
|
2020-02-12 02:21:42 +00:00
|
|
|
|
|
|
|
function g(bool b, uint x, uint y) public {
|
|
|
|
if (b)
|
|
|
|
f(a, maps[y]);
|
|
|
|
else
|
|
|
|
f(maps[x], maps[y]);
|
|
|
|
}
|
2019-02-21 12:01:58 +00:00
|
|
|
}
|
|
|
|
// ----
|
2020-06-19 00:26:46 +00:00
|
|
|
// Warning 4661: (397-417): Assertion violation happens here
|
|
|
|
// Warning 4661: (463-481): Assertion violation happens here
|
|
|
|
// Warning 4661: (533-557): Assertion violation happens here
|
|
|
|
// Warning 4661: (397-417): Assertion violation happens here
|
|
|
|
// Warning 4661: (463-481): Assertion violation happens here
|
|
|
|
// Warning 4661: (533-557): Assertion violation happens here
|
|
|
|
// Warning 4661: (397-417): Assertion violation happens here
|
|
|
|
// Warning 4661: (463-481): Assertion violation happens here
|
|
|
|
// Warning 4661: (533-557): Assertion violation happens here
|