diff --git a/libsolidity/Compiler.cpp b/libsolidity/Compiler.cpp index f6f48a8c2..28a9b3d10 100644 --- a/libsolidity/Compiler.cpp +++ b/libsolidity/Compiler.cpp @@ -43,9 +43,13 @@ void Compiler::compileContract(ContractDefinition const& _contract, for (ContractDefinition const* contract: _contract.getLinearizedBaseContracts()) { - for (ASTPointer const& function: contract->getDefinedFunctions()) - if (!function->isConstructor()) - m_context.addFunction(*function); + for (auto const& it: contract->getInterfaceFunctions()) + { + auto funcDef = it.second.getFunctionDefinition(); + if (funcDef && funcDef->isConstructor()) + continue; + m_context.addFunction(*it.second.getDeclaration()); + } for (ASTPointer const& modifier: contract->getFunctionModifiers()) m_context.addModifier(*modifier); } diff --git a/libsolidity/CompilerContext.cpp b/libsolidity/CompilerContext.cpp index 4edced940..ea349c0d2 100644 --- a/libsolidity/CompilerContext.cpp +++ b/libsolidity/CompilerContext.cpp @@ -59,11 +59,11 @@ void CompilerContext::addAndInitializeVariable(VariableDeclaration const& _decla *this << u256(0); } -void CompilerContext::addFunction(FunctionDefinition const& _function) +void CompilerContext::addFunction(Declaration const& _decl) { eth::AssemblyItem tag(m_asm.newTag()); - m_functionEntryLabels.insert(make_pair(&_function, tag)); - m_virtualFunctionEntryLabels.insert(make_pair(_function.getName(), tag)); + m_functionEntryLabels.insert(make_pair(&_decl, tag)); + m_virtualFunctionEntryLabels.insert(make_pair(_decl.getName(), tag)); } void CompilerContext::addModifier(ModifierDefinition const& _modifier) diff --git a/libsolidity/CompilerContext.h b/libsolidity/CompilerContext.h index aa438cf02..42ac9ee82 100644 --- a/libsolidity/CompilerContext.h +++ b/libsolidity/CompilerContext.h @@ -44,7 +44,7 @@ public: void startNewFunction() { m_localVariables.clear(); m_asm.setDeposit(0); } void addVariable(VariableDeclaration const& _declaration, unsigned _offsetToCurrent = 0); void addAndInitializeVariable(VariableDeclaration const& _declaration); - void addFunction(FunctionDefinition const& _function); + void addFunction(Declaration const& _decl); /// Adds the given modifier to the list by name if the name is not present already. void addModifier(ModifierDefinition const& _modifier);