Merge pull request #10529 from blishko/compound_assignment

[SMTChecker] Remove assert that is not true for compound assignment with right shift
This commit is contained in:
Leonardo 2020-12-08 15:43:36 +01:00 committed by GitHub
commit 71a4a4efb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View File

@ -1975,12 +1975,6 @@ smtutil::Expression SMTEncoder::compoundAssignment(Assignment const& _assignment
auto decl = identifierToVariable(_assignment.leftHandSide());
TypePointer commonType = Type::commonType(
_assignment.leftHandSide().annotation().type,
_assignment.rightHandSide().annotation().type
);
solAssert(commonType == _assignment.annotation().type, "");
if (compoundToBitwise.count(op))
return bitwiseOperation(
compoundToBitwise.at(op),

View File

@ -0,0 +1,11 @@
pragma experimental SMTChecker;
contract C {
function f(int a, uint b) public view {
a >>= tx.gasprice;
require(a == 16 && b == 2);
a >>= b;
assert(a == 4); // should hold
}
}
// ----