2019-07-30 18:32:49 +00:00
|
|
|
pragma experimental SMTChecker;
|
|
|
|
|
|
|
|
contract C
|
|
|
|
{
|
2020-02-12 02:21:42 +00:00
|
|
|
uint[2] b1;
|
|
|
|
uint[2] b2;
|
2019-07-30 18:32:49 +00:00
|
|
|
function f(uint[2] storage a, uint[2] memory c) internal {
|
2020-02-12 02:21:42 +00:00
|
|
|
c[0] = 42;
|
|
|
|
a[0] = 2;
|
|
|
|
b1[0] = 1;
|
2019-07-30 18:32:49 +00:00
|
|
|
// Erasing knowledge about storage variables should not
|
|
|
|
// erase knowledge about memory references.
|
|
|
|
assert(c[0] == 42);
|
2020-02-12 02:21:42 +00:00
|
|
|
// Fails because b1 == a is possible.
|
2019-07-30 18:32:49 +00:00
|
|
|
assert(a[0] == 2);
|
2020-02-12 02:21:42 +00:00
|
|
|
assert(b1[0] == 1);
|
|
|
|
}
|
|
|
|
function g(bool x, uint[2] memory c) public {
|
|
|
|
if (x) f(b1, c);
|
|
|
|
else f(b2, c);
|
2019-07-30 18:32:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// ----
|
2020-06-19 00:26:46 +00:00
|
|
|
// Warning 4661: (338-355): Assertion violation happens here
|
|
|
|
// Warning 4661: (338-355): Assertion violation happens here
|
|
|
|
// Warning 4661: (338-355): Assertion violation happens here
|