[SMTChecker] Fix unary operator on lvalue tuple

This commit is contained in:
Leonardo Alt
2020-09-01 08:25:06 +02:00
parent 34543e5eab
commit 50e0ada77d
6 changed files with 60 additions and 25 deletions
@@ -0,0 +1,11 @@
pragma experimental SMTChecker;
contract C {
function f(bool b) public pure {
uint x;
if (b) ++(x);
if (b) --(x);
if (b) delete(b);
assert(x == 0);
assert(!b);
}
}
@@ -0,0 +1,11 @@
pragma experimental SMTChecker;
contract C {
function f(bool b) public pure {
uint x;
if (b) ++((((((x))))));
if (b) --((((((x))))));
if (b) delete((((((b))))));
assert(x == 0);
assert(!b);
}
}
@@ -0,0 +1,12 @@
pragma experimental SMTChecker;
contract C {
function f(bool b) public pure {
uint x;
if (b) ++(x);
else x += 1;
assert(x == 1);
assert(!b);
}
}
// ----
// Warning 6328: (140-150): Assertion violation happens here