aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorLiana Husikyan <liana@ethdev.com>2015-03-19 23:48:54 +0800
committerLiana Husikyan <liana@ethdev.com>2015-03-25 20:59:39 +0800
commit607f3972349a17b9d06aca0ce733789f16f573c1 (patch)
tree118f8aa3cd87527d570122f8539a734c65ec8350 /Types.cpp
parenta69d59ae717f5bef1995c20e46ea94b8acff18c2 (diff)
downloaddexon-solidity-607f3972349a17b9d06aca0ce733789f16f573c1.tar.gz
dexon-solidity-607f3972349a17b9d06aca0ce733789f16f573c1.tar.zst
dexon-solidity-607f3972349a17b9d06aca0ce733789f16f573c1.zip
added externalType for ArrayType
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/Types.cpp b/Types.cpp
index 016f0b23..6fe8a641 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -742,6 +742,23 @@ string ArrayType::toString() const
return ret + "]";
}
+TypePointer ArrayType::externalType() const
+{
+ if (m_location != Location::CallData)
+ return TypePointer();
+ if (m_isByteArray)
+ return shared_from_this();
+ if (!(m_baseType->externalType()))
+ return TypePointer();
+ if (dynamic_cast<ArrayType const*>(m_baseType.get()) && m_baseType->isDynamicallySized())
+ return TypePointer();
+
+ if (m_baseType->isDynamicallySized())
+ return std::make_shared<ArrayType>(Location::CallData, m_baseType->externalType());
+ else
+ return std::make_shared<ArrayType>(Location::CallData, m_baseType->externalType(), m_length);
+}
+
shared_ptr<ArrayType> ArrayType::copyForLocation(ArrayType::Location _location) const
{
auto copy = make_shared<ArrayType>(_location);