diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-03-19 23:48:54 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-03-25 20:59:39 +0800 |
commit | 607f3972349a17b9d06aca0ce733789f16f573c1 (patch) | |
tree | 118f8aa3cd87527d570122f8539a734c65ec8350 /Types.cpp | |
parent | a69d59ae717f5bef1995c20e46ea94b8acff18c2 (diff) | |
download | dexon-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.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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); |