mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #9706 from ethereum/smt_fix_tuple_lvalue
[SMTChecker] Fix unary operator on lvalue tuple
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user