diff options
author | Christian <c@ethdev.com> | 2014-11-20 01:56:10 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-11-24 04:04:39 +0800 |
commit | 735dbe69861d6f80368c057423a13ab1d1a9b557 (patch) | |
tree | 57a8c2c6ae7253d5449444646f38c0e51fb80558 /Types.cpp | |
parent | 93c98a6e52ec95a533e69292a872144ad0dfd101 (diff) | |
download | dexon-solidity-735dbe69861d6f80368c057423a13ab1d1a9b557.tar.gz dexon-solidity-735dbe69861d6f80368c057423a13ab1d1a9b557.tar.zst dexon-solidity-735dbe69861d6f80368c057423a13ab1d1a9b557.zip |
We only care about member types.
Diffstat (limited to 'Types.cpp')
-rw-r--r-- | Types.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -234,7 +234,7 @@ u256 StructType::getStorageSize() const bool StructType::canLiveOutsideStorage() const { for (unsigned i = 0; i < getMemberCount(); ++i) - if (!getMemberByIndex(i).getType()->canLiveOutsideStorage()) + if (!getMemberByIndex(i)->canLiveOutsideStorage()) return false; return true; } @@ -258,9 +258,9 @@ unsigned StructType::memberNameToIndex(string const& _name) const return unsigned(-1); } -VariableDeclaration const& StructType::getMemberByIndex(unsigned _index) const +shared_ptr<Type const> const& StructType::getMemberByIndex(unsigned _index) const { - return *m_struct.getMembers()[_index]; + return m_struct.getMembers()[_index].getType(); } u256 StructType::getStorageOffsetOfMember(unsigned _index) const @@ -269,7 +269,7 @@ u256 StructType::getStorageOffsetOfMember(unsigned _index) const u256 offset; // vector<ASTPointer<VariableDeclaration>> const& members = m_struct.getMembers(); for (unsigned index = 0; index < _index; ++index) - offset += getMemberByIndex(index).getType()->getStorageSize(); + offset += getMemberByIndex(index)->getStorageSize(); return offset; } |