diff --git a/libsolidity/codegen/ir/IRGenerator.cpp b/libsolidity/codegen/ir/IRGenerator.cpp index fb466f3ba..620daa86e 100644 --- a/libsolidity/codegen/ir/IRGenerator.cpp +++ b/libsolidity/codegen/ir/IRGenerator.cpp @@ -302,22 +302,26 @@ pair> IRGenerator::evaluateConstr for (ASTPointer const& base: _contract.baseContracts()) if (FunctionDefinition const* baseConstructor = dynamic_cast( - base->name().annotation().referencedDeclaration + base->name().annotation().referencedDeclaration )->constructor(); baseConstructor && base->arguments()) baseConstructorArguments.emplace_back( - dynamic_cast(baseConstructor->scope()), - base->arguments() + dynamic_cast(baseConstructor->scope()), + base->arguments() ); if (FunctionDefinition const* constructor = _contract.constructor()) - for (auto const& modifier: constructor->modifiers()) - if (FunctionDefinition const* baseConstructor = dynamic_cast( + for (ASTPointer const& modifier: constructor->modifiers()) + if (auto const* baseContract = dynamic_cast( modifier->name()->annotation().referencedDeclaration - )->constructor(); baseConstructor && modifier->arguments()) - baseConstructorArguments.emplace_back( - dynamic_cast(baseConstructor->scope()), - modifier->arguments() - ); + )) + if ( + FunctionDefinition const* baseConstructor = baseContract->constructor(); + baseConstructor && modifier->arguments() + ) + baseConstructorArguments.emplace_back( + dynamic_cast(baseConstructor->scope()), + modifier->arguments() + ); IRGeneratorForStatements generator{m_context, m_utils}; for (auto&& [baseContract, arguments]: baseConstructorArguments)