aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AST.cpp4
-rw-r--r--Types.cpp17
2 files changed, 13 insertions, 8 deletions
diff --git a/AST.cpp b/AST.cpp
index 7333c024..09af49c6 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -340,8 +340,10 @@ vector<pair<FixedHash<4>, FunctionTypePointer>> const& ContractDefinition::getIn
{
for (ASTPointer<FunctionDefinition> const& f: contract->getDefinedFunctions())
{
+ if (!f->isPartOfExternalInterface())
+ continue;
string functionSignature = f->externalSignature();
- if (f->isPartOfExternalInterface() && signaturesSeen.count(functionSignature) == 0)
+ if (signaturesSeen.count(functionSignature) == 0)
{
functionsSeen.insert(f->getName());
signaturesSeen.insert(functionSignature);
diff --git a/Types.cpp b/Types.cpp
index 01876b5a..15c36742 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -827,15 +827,16 @@ TypePointer ArrayType::externalType() const
{
if (m_arrayKind != ArrayKind::Ordinary)
return this->copyForLocation(DataLocation::Memory, true);
- if (!m_baseType->externalType())
+ TypePointer baseExt = m_baseType->externalType();
+ if (!baseExt)
return TypePointer();
if (m_baseType->getCategory() == Category::Array && m_baseType->isDynamicallySized())
return TypePointer();
if (isDynamicallySized())
- return std::make_shared<ArrayType>(DataLocation::Memory, m_baseType->externalType());
+ return std::make_shared<ArrayType>(DataLocation::Memory, baseExt);
else
- return std::make_shared<ArrayType>(DataLocation::Memory, m_baseType->externalType(), m_length);
+ return std::make_shared<ArrayType>(DataLocation::Memory, baseExt, m_length);
}
TypePointer ArrayType::copyForLocation(DataLocation _location, bool _isPointer) const
@@ -1268,15 +1269,17 @@ FunctionTypePointer FunctionType::externalFunctionType() const
for (auto type: m_parameterTypes)
{
- if (!type->externalType())
+ if (auto ext = type->externalType())
+ paramTypes.push_back(ext);
+ else
return FunctionTypePointer();
- paramTypes.push_back(type->externalType());
}
for (auto type: m_returnParameterTypes)
{
- if (!type->externalType())
+ if (auto ext = type->externalType())
+ retParamTypes.push_back(ext);
+ else
return FunctionTypePointer();
- retParamTypes.push_back(type->externalType());
}
return make_shared<FunctionType>(paramTypes, retParamTypes, m_parameterNames, m_returnParameterNames, m_location, m_arbitraryParameters);
}