diff options
author | LianaHus <liana@ethdev.com> | 2015-09-23 23:31:37 +0800 |
---|---|---|
committer | LianaHus <liana@ethdev.com> | 2015-09-23 23:31:37 +0800 |
commit | 9547c4563c09fa816330ccd539d393344ac03fb4 (patch) | |
tree | a1dbe51789424f933f63dc5ee891c6410203b8bd /libsolidity/Types.cpp | |
parent | 09f1f1e5955fc358697b49542c6c8eb42496ef10 (diff) | |
download | dexon-solidity-9547c4563c09fa816330ccd539d393344ac03fb4.tar.gz dexon-solidity-9547c4563c09fa816330ccd539d393344ac03fb4.tar.zst dexon-solidity-9547c4563c09fa816330ccd539d393344ac03fb4.zip |
fixed-sized arrays as return type
Conflicts:
test/libsolidity/SolidityEndToEndTest.cpp
Diffstat (limited to 'libsolidity/Types.cpp')
-rw-r--r-- | libsolidity/Types.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libsolidity/Types.cpp b/libsolidity/Types.cpp index 68e8e91d..43120ce5 100644 --- a/libsolidity/Types.cpp +++ b/libsolidity/Types.cpp @@ -853,6 +853,14 @@ TypePointer ArrayType::externalType() const return std::make_shared<ArrayType>(DataLocation::Memory, baseExt, m_length); } +u256 ArrayType::memorySize() const +{ + solAssert(!isDynamicallySized(), ""); + solAssert(m_location == DataLocation::Memory, ""); + + return m_length * m_baseType->memoryHeadSize(); +} + TypePointer ArrayType::copyForLocation(DataLocation _location, bool _isPointer) const { auto copy = make_shared<ArrayType>(_location); |