Merge pull request #9692 from ethereum/smt_fix_pop

[SMTChecker] Fix soundness of array pop
This commit is contained in:
chriseth
2020-08-31 20:07:58 +02:00
committed by GitHub
11 changed files with 104 additions and 5 deletions
+4 -4
View File
@@ -1111,11 +1111,11 @@ void SMTEncoder::arrayPop(FunctionCall const& _funCall)
symbArray->increaseIndex();
m_context.addAssertion(symbArray->elements() == oldElements);
auto newLength = smtutil::Expression::ite(
oldLength == 0,
smt::maxValue(*TypeProvider::uint256()),
oldLength - 1
oldLength > 0,
oldLength - 1,
0
);
m_context.addAssertion(symbArray->length() == oldLength - 1);
m_context.addAssertion(symbArray->length() == newLength);
arrayPushPopAssign(memberAccess->expression(), symbArray->currentValue());
}