mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4565 from ethereum/smt-stringutils-crash
Add assert for both branches in mergeVariables in SMTChecker
This commit is contained in:
commit
ae15b52d93
@ -429,7 +429,14 @@ void SMTChecker::arithmeticOperation(BinaryOperation const& _op)
|
||||
case Token::Div:
|
||||
{
|
||||
solAssert(_op.annotation().commonType, "");
|
||||
solAssert(_op.annotation().commonType->category() == Type::Category::Integer, "");
|
||||
if (_op.annotation().commonType->category() != Type::Category::Integer)
|
||||
{
|
||||
m_errorReporter.warning(
|
||||
_op.location(),
|
||||
"Assertion checker does not yet implement this operator on non-integer types."
|
||||
);
|
||||
break;
|
||||
}
|
||||
auto const& intType = dynamic_cast<IntegerType const&>(*_op.annotation().commonType);
|
||||
smt::Expression left(expr(_op.leftExpression()));
|
||||
smt::Expression right(expr(_op.rightExpression()));
|
||||
@ -752,6 +759,7 @@ void SMTChecker::mergeVariables(vector<VariableDeclaration const*> const& _varia
|
||||
set<VariableDeclaration const*> uniqueVars(_variables.begin(), _variables.end());
|
||||
for (auto const* decl: uniqueVars)
|
||||
{
|
||||
solAssert(_countersEndTrue.count(decl) && _countersEndFalse.count(decl), "");
|
||||
int trueCounter = _countersEndTrue.at(decl).index();
|
||||
int falseCounter = _countersEndFalse.at(decl).index();
|
||||
solAssert(trueCounter != falseCounter, "");
|
||||
|
Loading…
Reference in New Issue
Block a user