aboutsummaryrefslogtreecommitdiffstats
path: root/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-11-20 17:19:43 +0800
committerChristian <c@ethdev.com>2014-11-24 04:04:39 +0800
commitfa987e0a206bba35cfe6e311f8bad1470d9b5d4f (patch)
treeb38d2fd49846c2dadf83ff6b1458f432927a1bab /ExpressionCompiler.cpp
parent735dbe69861d6f80368c057423a13ab1d1a9b557 (diff)
downloaddexon-solidity-fa987e0a206bba35cfe6e311f8bad1470d9b5d4f.tar.gz
dexon-solidity-fa987e0a206bba35cfe6e311f8bad1470d9b5d4f.tar.zst
dexon-solidity-fa987e0a206bba35cfe6e311f8bad1470d9b5d4f.zip
Convenience class for type members.
Diffstat (limited to 'ExpressionCompiler.cpp')
-rw-r--r--ExpressionCompiler.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp
index f37ce39c..89eeb31f 100644
--- a/ExpressionCompiler.cpp
+++ b/ExpressionCompiler.cpp
@@ -208,10 +208,7 @@ void ExpressionCompiler::endVisit(MemberAccess& _memberAccess)
if (asserts(m_currentLValue.isInStorage()))
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Member access to a non-storage value."));
StructType const& type = dynamic_cast<StructType const&>(*_memberAccess.getExpression().getType());
- unsigned memberIndex = type.memberNameToIndex(_memberAccess.getMemberName());
- if (asserts(memberIndex <= type.getMemberCount()))
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Member not found in struct during compilation."));
- m_context << type.getStorageOffsetOfMember(memberIndex) << eth::Instruction::ADD;
+ m_context << type.getStorageOffsetOfMember(_memberAccess.getMemberName()) << eth::Instruction::ADD;
m_currentLValue.retrieveValueIfLValueNotRequested(_memberAccess);
}