mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[SMTChecker] Fix SMT logic error when doing compound assignment with string literlas.
This commit is contained in:
@@ -1927,18 +1927,24 @@ 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),
|
||||
decl ? currentValue(*decl) : expr(_assignment.leftHandSide()),
|
||||
expr(_assignment.rightHandSide()),
|
||||
decl ? currentValue(*decl) : expr(_assignment.leftHandSide(), _assignment.annotation().type),
|
||||
expr(_assignment.rightHandSide(), _assignment.annotation().type),
|
||||
_assignment.annotation().type
|
||||
);
|
||||
|
||||
auto values = arithmeticOperation(
|
||||
compoundToArithmetic.at(op),
|
||||
decl ? currentValue(*decl) : expr(_assignment.leftHandSide()),
|
||||
expr(_assignment.rightHandSide()),
|
||||
decl ? currentValue(*decl) : expr(_assignment.leftHandSide(), _assignment.annotation().type),
|
||||
expr(_assignment.rightHandSide(), _assignment.annotation().type),
|
||||
_assignment.annotation().type,
|
||||
_assignment
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user