aboutsummaryrefslogtreecommitdiffstats
path: root/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-06-05 17:07:50 +0800
committerchriseth <c@ethdev.com>2015-06-05 20:44:05 +0800
commitf4d1acc563a972ee4f5a44c690cd3fdd1783ae97 (patch)
treeb2814613dff69ffe8f1e14ef6160dcc0902eb3c4 /ExpressionCompiler.cpp
parent4987eec3d1e87868e091850d31af58e054ab5ee5 (diff)
downloaddexon-solidity-f4d1acc563a972ee4f5a44c690cd3fdd1783ae97.tar.gz
dexon-solidity-f4d1acc563a972ee4f5a44c690cd3fdd1783ae97.tar.zst
dexon-solidity-f4d1acc563a972ee4f5a44c690cd3fdd1783ae97.zip
Ability to specify the storage location of a reference type.
Diffstat (limited to 'ExpressionCompiler.cpp')
-rw-r--r--ExpressionCompiler.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp
index 51bdfbc4..62df9205 100644
--- a/ExpressionCompiler.cpp
+++ b/ExpressionCompiler.cpp
@@ -770,12 +770,12 @@ void ExpressionCompiler::endVisit(MemberAccess const& _memberAccess)
m_context << type.getLength();
}
else
- switch (type.getLocation())
+ switch (type.location())
{
- case ArrayType::Location::CallData:
+ case ReferenceType::Location::CallData:
m_context << eth::Instruction::SWAP1 << eth::Instruction::POP;
break;
- case ArrayType::Location::Storage:
+ case ReferenceType::Location::Storage:
setLValue<StorageArrayLength>(_memberAccess, type);
break;
default:
@@ -816,13 +816,13 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess)
solAssert(_indexAccess.getIndexExpression(), "Index expression expected.");
// remove storage byte offset
- if (arrayType.getLocation() == ArrayType::Location::Storage)
+ if (arrayType.location() == ReferenceType::Location::Storage)
m_context << eth::Instruction::POP;
_indexAccess.getIndexExpression()->accept(*this);
// stack layout: <base_ref> [<length>] <index>
ArrayUtils(m_context).accessIndex(arrayType);
- if (arrayType.getLocation() == ArrayType::Location::Storage)
+ if (arrayType.location() == ReferenceType::Location::Storage)
{
if (arrayType.isByteArray())
{
@@ -1169,13 +1169,13 @@ void ExpressionCompiler::appendArgumentsCopyToMemory(
auto const& arrayType = dynamic_cast<ArrayType const&>(*_arguments[i]->getType());
// move memory reference to top of stack
CompilerUtils(m_context).moveToStackTop(arrayType.getSizeOnStack());
- if (arrayType.getLocation() == ArrayType::Location::CallData)
+ if (arrayType.location() == ReferenceType::Location::CallData)
m_context << eth::Instruction::DUP2; // length is on stack
- else if (arrayType.getLocation() == ArrayType::Location::Storage)
+ else if (arrayType.location() == ReferenceType::Location::Storage)
m_context << eth::Instruction::DUP3 << eth::Instruction::SLOAD;
else
{
- solAssert(arrayType.getLocation() == ArrayType::Location::Memory, "");
+ solAssert(arrayType.location() == ReferenceType::Location::Memory, "");
m_context << eth::Instruction::DUP2 << eth::Instruction::MLOAD;
}
appendTypeMoveToMemory(IntegerType(256), true);