diff options
author | chriseth <c@ethdev.com> | 2015-06-27 02:27:56 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-06-27 02:27:56 +0800 |
commit | 109b4eafb9d543abb13ed24055bd71d4f67cb9ec (patch) | |
tree | d3ef61cf7f896d36b40a176d8caa2b8c7ceb5e2f /Compiler.cpp | |
parent | 37e7f1f10d597efb7773417779e32f0533b6ba1b (diff) | |
download | dexon-solidity-109b4eafb9d543abb13ed24055bd71d4f67cb9ec.tar dexon-solidity-109b4eafb9d543abb13ed24055bd71d4f67cb9ec.tar.gz dexon-solidity-109b4eafb9d543abb13ed24055bd71d4f67cb9ec.tar.bz2 dexon-solidity-109b4eafb9d543abb13ed24055bd71d4f67cb9ec.tar.lz dexon-solidity-109b4eafb9d543abb13ed24055bd71d4f67cb9ec.tar.xz dexon-solidity-109b4eafb9d543abb13ed24055bd71d4f67cb9ec.tar.zst dexon-solidity-109b4eafb9d543abb13ed24055bd71d4f67cb9ec.zip |
Some fixes for calldata arrays.
Diffstat (limited to 'Compiler.cpp')
-rw-r--r-- | Compiler.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Compiler.cpp b/Compiler.cpp index 788e07ef..6ed6480f 100644 --- a/Compiler.cpp +++ b/Compiler.cpp @@ -261,7 +261,7 @@ void Compiler::appendCalldataUnpacker( { // We do not check the calldata size, everything is zero-paddedd - //@todo this does not yet support nested arrays + //@todo this does not yet support nested dynamic arrays if (_startOffset == u256(-1)) _startOffset = u256(CompilerUtils::dataStartOffset); @@ -279,6 +279,12 @@ void Compiler::appendCalldataUnpacker( solAssert(!arrayType.getBaseType()->isDynamicallySized(), "Nested arrays not yet implemented."); if (_fromMemory) { + solAssert( + arrayType.getBaseType()->isValueType(), + "Nested memory arrays not yet implemented here." + ); + // @todo If base type is an array or struct, it is still calldata-style encoded, so + // we would have to convert it like below. solAssert(arrayType.location() == DataLocation::Memory, ""); // compute data pointer m_context << eth::Instruction::DUP1 << eth::Instruction::MLOAD; @@ -311,6 +317,7 @@ void Compiler::appendCalldataUnpacker( } if (arrayType.location() == DataLocation::Memory) { + // stack: calldata_ref [length] next_calldata // copy to memory // move calldata type up again CompilerUtils(m_context).moveIntoStack(calldataType->getSizeOnStack()); |