aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerContext.cpp
diff options
context:
space:
mode:
authorLu Guanqun <guanqun.lu@gmail.com>2015-03-01 11:34:12 +0800
committerLu Guanqun <guanqun.lu@gmail.com>2015-03-08 22:48:53 +0800
commite008f3f808b1483e7b7a5861ea4fe46fbe74bcff (patch)
tree1220efd2be6aca0026e184a313a6fdb53d353fa2 /CompilerContext.cpp
parent068bb5d7316fea411ef8e20eb3f6844c9c10dd23 (diff)
downloaddexon-solidity-e008f3f808b1483e7b7a5861ea4fe46fbe74bcff.tar
dexon-solidity-e008f3f808b1483e7b7a5861ea4fe46fbe74bcff.tar.gz
dexon-solidity-e008f3f808b1483e7b7a5861ea4fe46fbe74bcff.tar.bz2
dexon-solidity-e008f3f808b1483e7b7a5861ea4fe46fbe74bcff.tar.lz
dexon-solidity-e008f3f808b1483e7b7a5861ea4fe46fbe74bcff.tar.xz
dexon-solidity-e008f3f808b1483e7b7a5861ea4fe46fbe74bcff.tar.zst
dexon-solidity-e008f3f808b1483e7b7a5861ea4fe46fbe74bcff.zip
the contract interfaces should take overloaded function into consideration TODO:
Diffstat (limited to 'CompilerContext.cpp')
-rw-r--r--CompilerContext.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/CompilerContext.cpp b/CompilerContext.cpp
index ee8d3e00..f787db7f 100644
--- a/CompilerContext.cpp
+++ b/CompilerContext.cpp
@@ -106,8 +106,12 @@ eth::AssemblyItem CompilerContext::getVirtualFunctionEntryLabel(FunctionDefiniti
solAssert(!m_inheritanceHierarchy.empty(), "No inheritance hierarchy set.");
for (ContractDefinition const* contract: m_inheritanceHierarchy)
for (ASTPointer<FunctionDefinition> const& function: contract->getDefinedFunctions())
- if (!function->isConstructor() && function->getName() == _function.getName())
+ {
+ if (!function->isConstructor() &&
+ dynamic_cast<FunctionType const&>(*function->getType()).getCanonicalSignature() ==
+ dynamic_cast<FunctionType const&>(*_function.getType()).getCanonicalSignature())
return getFunctionEntryLabel(*function);
+ }
solAssert(false, "Virtual function " + _function.getName() + " not found.");
return m_asm.newTag(); // not reached
}
@@ -117,7 +121,7 @@ eth::AssemblyItem CompilerContext::getSuperFunctionEntryLabel(string const& _nam
auto it = getSuperContract(_base);
for (; it != m_inheritanceHierarchy.end(); ++it)
for (ASTPointer<FunctionDefinition> const& function: (*it)->getDefinedFunctions())
- if (!function->isConstructor() && function->getName() == _name)
+ if (!function->isConstructor() && function->getName() == _name) // TODO: add a test case for this!
return getFunctionEntryLabel(*function);
solAssert(false, "Super function " + _name + " not found.");
return m_asm.newTag(); // not reached