diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-03-26 19:22:49 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-04-08 21:56:35 +0800 |
commit | 7eec25b6eb07f1549725884221402a6e692b46e1 (patch) | |
tree | 6500908fb944f36690a1c3ade5cd2366698bde89 /ExpressionCompiler.cpp | |
parent | 45870ed956aa787d05adb191ef10354d197f1688 (diff) | |
download | dexon-solidity-7eec25b6eb07f1549725884221402a6e692b46e1.tar.gz dexon-solidity-7eec25b6eb07f1549725884221402a6e692b46e1.tar.zst dexon-solidity-7eec25b6eb07f1549725884221402a6e692b46e1.zip |
added createing FunctionType from ArrayType VariableDeclaration
added test
Diffstat (limited to 'ExpressionCompiler.cpp')
-rw-r--r-- | ExpressionCompiler.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp index daea2162..59781f82 100644 --- a/ExpressionCompiler.cpp +++ b/ExpressionCompiler.cpp @@ -71,16 +71,20 @@ void ExpressionCompiler::appendStateVariableAccessor(VariableDeclaration const& m_context << location.first; TypePointer returnType = _varDecl.getType(); - for (TypePointer const& paramType: paramTypes) + if (ArrayType const* arrayType = dynamic_cast<ArrayType const*>(returnType.get())) { - // move offset to memory - CompilerUtils(m_context).storeInMemory(length); - unsigned argLen = paramType->getCalldataEncodedSize(); - length -= argLen; - m_context << u256(argLen + 32) << u256(length) << eth::Instruction::SHA3; + (void)arrayType; + } else + for (TypePointer const& paramType: paramTypes) + { + // move offset to memory + CompilerUtils(m_context).storeInMemory(length); + unsigned argLen = paramType->getCalldataEncodedSize(); + length -= argLen; + m_context << u256(argLen + 32) << u256(length) << eth::Instruction::SHA3; - returnType = dynamic_cast<MappingType const&>(*returnType).getValueType(); - } + returnType = dynamic_cast<MappingType const&>(*returnType).getValueType(); + } unsigned retSizeOnStack = 0; solAssert(accessorType.getReturnParameterTypes().size() >= 1, ""); |