Merge pull request #7823 from ethereum/smt_typetype_msg

[SMTChecker] Do not visit the name of a modifier invocation
This commit is contained in:
chriseth 2019-11-27 23:19:52 +01:00 committed by GitHub
commit 9ec44c2ec1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 3 deletions

View File

@ -537,6 +537,15 @@ void SMTEncoder::endVisit(FunctionCall const& _funCall)
} }
} }
bool SMTEncoder::visit(ModifierInvocation const& _node)
{
if (auto const* args = _node.arguments())
for (auto const& arg: *args)
if (arg)
arg->accept(*this);
return false;
}
void SMTEncoder::initContract(ContractDefinition const& _contract) void SMTEncoder::initContract(ContractDefinition const& _contract)
{ {
solAssert(m_currentContract == nullptr, ""); solAssert(m_currentContract == nullptr, "");
@ -605,9 +614,7 @@ void SMTEncoder::endVisit(Identifier const& _identifier)
defineExpr(_identifier, m_context.thisAddress()); defineExpr(_identifier, m_context.thisAddress());
m_uninterpretedTerms.insert(&_identifier); m_uninterpretedTerms.insert(&_identifier);
} }
else if ( else
_identifier.annotation().type->category() != Type::Category::Modifier
)
createExpr(_identifier); createExpr(_identifier);
} }

View File

@ -82,6 +82,7 @@ protected:
bool visit(BinaryOperation const& _node) override; bool visit(BinaryOperation const& _node) override;
void endVisit(BinaryOperation const& _node) override; void endVisit(BinaryOperation const& _node) override;
void endVisit(FunctionCall const& _node) override; void endVisit(FunctionCall const& _node) override;
bool visit(ModifierInvocation const& _node) override;
void endVisit(Identifier const& _node) override; void endVisit(Identifier const& _node) override;
void endVisit(ElementaryTypeNameExpression const& _node) override; void endVisit(ElementaryTypeNameExpression const& _node) override;
void endVisit(Literal const& _node) override; void endVisit(Literal const& _node) override;

View File

@ -0,0 +1,17 @@
pragma experimental SMTChecker;
contract A {
uint x;
constructor() public {
x = 2;
}
}
contract B is A {
constructor() A() public {
x = 3;
}
}
// ----
// Warning: (56-90): Assertion checker does not yet support constructors.
// Warning: (113-151): Assertion checker does not yet support constructors.