Fix incorrect behaviour on clang 6.

This commit is contained in:
Daniel Kirchner 2020-12-10 17:20:30 +01:00
parent d84415cb3b
commit c400c61fc3

View File

@ -164,11 +164,11 @@ void CHC::endVisit(ContractDefinition const& _contract)
if (base != &_contract) if (base != &_contract)
{ {
m_callGraph[&_contract].insert(base); m_callGraph[&_contract].insert(base);
vector<ASTPointer<Expression>> const& args = baseArgs.count(base) ? baseArgs.at(base) : decltype(args){};
auto baseConstructor = base->constructor(); auto baseConstructor = base->constructor();
if (baseConstructor && !args.empty()) if (baseConstructor && baseArgs.count(base))
{ {
vector<ASTPointer<Expression>> const& args = baseArgs.at(base);
auto const& params = baseConstructor->parameters(); auto const& params = baseConstructor->parameters();
solAssert(params.size() == args.size(), ""); solAssert(params.size() == args.size(), "");
for (unsigned i = 0; i < params.size(); ++i) for (unsigned i = 0; i < params.size(); ++i)