diff options
author | Christian <c@ethdev.com> | 2015-02-26 03:27:55 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-02-28 05:52:19 +0800 |
commit | 87365f7612336c4c7f443aac568f8a515bc9bd35 (patch) | |
tree | e304628c5c65d0fb33082d1c8f9e49776fb0a70c /ExpressionCompiler.cpp | |
parent | a5b4f18dd7291e403237061d5f9660db0299601d (diff) | |
download | dexon-solidity-87365f7612336c4c7f443aac568f8a515bc9bd35.tar.gz dexon-solidity-87365f7612336c4c7f443aac568f8a515bc9bd35.tar.zst dexon-solidity-87365f7612336c4c7f443aac568f8a515bc9bd35.zip |
Shortening of dynamic arrays.
Diffstat (limited to 'ExpressionCompiler.cpp')
-rw-r--r-- | ExpressionCompiler.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp index 430e46b0..cdf9436d 100644 --- a/ExpressionCompiler.cpp +++ b/ExpressionCompiler.cpp @@ -93,7 +93,7 @@ void ExpressionCompiler::appendStateVariableAccessor(VariableDeclaration const& m_context << eth::Instruction::DUP1 << structType->getStorageOffsetOfMember(names[i]) << eth::Instruction::ADD; - StorageItem(m_context, types[i]).retrieveValue(SourceLocation(), true); + StorageItem(m_context, *types[i]).retrieveValue(SourceLocation(), true); solAssert(types[i]->getSizeOnStack() == 1, "Returning struct elements with stack size != 1 not yet implemented."); m_context << eth::Instruction::SWAP1; retSizeOnStack += types[i]->getSizeOnStack(); @@ -104,7 +104,7 @@ void ExpressionCompiler::appendStateVariableAccessor(VariableDeclaration const& { // simple value solAssert(accessorType.getReturnParameterTypes().size() == 1, ""); - StorageItem(m_context, returnType).retrieveValue(SourceLocation(), true); + StorageItem(m_context, *returnType).retrieveValue(SourceLocation(), true); retSizeOnStack = returnType->getSizeOnStack(); } solAssert(retSizeOnStack <= 15, "Stack too deep."); @@ -680,7 +680,7 @@ void ExpressionCompiler::endVisit(MemberAccess const& _memberAccess) m_context << eth::Instruction::SWAP1 << eth::Instruction::POP; break; case ArrayType::Location::Storage: - setLValueToStorageItem(_memberAccess); + setLValue<StorageArrayLength>(_memberAccess, type); break; default: solAssert(false, "Unsupported array location."); @@ -1044,7 +1044,7 @@ void ExpressionCompiler::setLValueFromDeclaration(Declaration const& _declaratio void ExpressionCompiler::setLValueToStorageItem(Expression const& _expression) { - setLValue<StorageItem>(_expression, _expression.getType()); + setLValue<StorageItem>(_expression, *_expression.getType()); } } |