mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix expression creation problems.
This commit is contained in:
parent
00e252a39f
commit
a256983320
@ -207,7 +207,10 @@ void SMTChecker::endVisit(Assignment const& _assignment)
|
|||||||
{
|
{
|
||||||
Declaration const* decl = identifier->annotation().referencedDeclaration;
|
Declaration const* decl = identifier->annotation().referencedDeclaration;
|
||||||
if (knownVariable(*decl))
|
if (knownVariable(*decl))
|
||||||
|
{
|
||||||
assignment(*decl, _assignment.rightHandSide(), _assignment.location());
|
assignment(*decl, _assignment.rightHandSide(), _assignment.location());
|
||||||
|
defineExpr(_assignment, expr(_assignment.rightHandSide()));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
m_errorReporter.warning(
|
m_errorReporter.warning(
|
||||||
_assignment.location(),
|
_assignment.location(),
|
||||||
@ -778,13 +781,20 @@ smt::Expression SMTChecker::maxValue(IntegerType const& _t)
|
|||||||
|
|
||||||
smt::Expression SMTChecker::expr(Expression const& _e)
|
smt::Expression SMTChecker::expr(Expression const& _e)
|
||||||
{
|
{
|
||||||
solAssert(m_expressions.count(&_e), "");
|
if (!m_expressions.count(&_e))
|
||||||
|
{
|
||||||
|
m_errorReporter.warning(_e.location(), "Internal error: Expression undefined for SMT solver." );
|
||||||
|
createExpr(_e);
|
||||||
|
}
|
||||||
return m_expressions.at(&_e);
|
return m_expressions.at(&_e);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SMTChecker::createExpr(Expression const& _e)
|
void SMTChecker::createExpr(Expression const& _e)
|
||||||
{
|
{
|
||||||
solAssert(!m_expressions.count(&_e), "");
|
if (m_expressions.count(&_e))
|
||||||
|
m_errorReporter.warning(_e.location(), "Internal error: Expression created twice in SMT solver." );
|
||||||
|
else
|
||||||
|
{
|
||||||
solAssert(_e.annotation().type, "");
|
solAssert(_e.annotation().type, "");
|
||||||
switch (_e.annotation().type->category())
|
switch (_e.annotation().type->category())
|
||||||
{
|
{
|
||||||
@ -805,6 +815,7 @@ void SMTChecker::createExpr(Expression const& _e)
|
|||||||
solAssert(false, "Type not implemented.");
|
solAssert(false, "Type not implemented.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SMTChecker::defineExpr(Expression const& _e, smt::Expression _value)
|
void SMTChecker::defineExpr(Expression const& _e, smt::Expression _value)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user