diff options
author | chriseth <c@ethdev.com> | 2015-07-14 17:58:16 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-07-14 17:58:16 +0800 |
commit | 73275e18250954431c58323a2d678409b0824568 (patch) | |
tree | 47a2216e5d55389211e30b5117a8f2e123923898 /ExpressionCompiler.cpp | |
parent | da818b1acdd8f02fccd18779cfb0ac397d7e61b1 (diff) | |
download | dexon-solidity-73275e18250954431c58323a2d678409b0824568.tar dexon-solidity-73275e18250954431c58323a2d678409b0824568.tar.gz dexon-solidity-73275e18250954431c58323a2d678409b0824568.tar.bz2 dexon-solidity-73275e18250954431c58323a2d678409b0824568.tar.lz dexon-solidity-73275e18250954431c58323a2d678409b0824568.tar.xz dexon-solidity-73275e18250954431c58323a2d678409b0824568.tar.zst dexon-solidity-73275e18250954431c58323a2d678409b0824568.zip |
Use only a single stack slot for storage references.
Diffstat (limited to 'ExpressionCompiler.cpp')
-rw-r--r-- | ExpressionCompiler.cpp | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp index 05835818..d949265d 100644 --- a/ExpressionCompiler.cpp +++ b/ExpressionCompiler.cpp @@ -714,7 +714,6 @@ void ExpressionCompiler::endVisit(MemberAccess const& _memberAccess) { case DataLocation::Storage: { - m_context << eth::Instruction::POP; // structs always align to new slot pair<u256, unsigned> const& offsets = type.getStorageOffsetsOfMember(member); m_context << offsets.first << eth::Instruction::ADD << u256(offsets.second); setLValueToStorageItem(_memberAccess); @@ -792,8 +791,6 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess) Type const& baseType = *_indexAccess.getBaseExpression().getType(); if (baseType.getCategory() == Type::Category::Mapping) { - // storage byte offset is ignored for mappings, it should be zero. - m_context << eth::Instruction::POP; // stack: storage_base_ref Type const& keyType = *dynamic_cast<MappingType const&>(baseType).getKeyType(); m_context << u256(0); // memory position @@ -812,10 +809,6 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess) ArrayType const& arrayType = dynamic_cast<ArrayType const&>(baseType); solAssert(_indexAccess.getIndexExpression(), "Index expression expected."); - // remove storage byte offset - if (arrayType.location() == DataLocation::Storage) - m_context << eth::Instruction::POP; - _indexAccess.getIndexExpression()->accept(*this); // stack layout: <base_ref> [<length>] <index> ArrayUtils(m_context).accessIndex(arrayType); |