diff options
author | chriseth <c@ethdev.com> | 2015-10-02 19:11:38 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-10-06 20:19:56 +0800 |
commit | 9cc7402c9583ca3bfc9fcb234443d2f90b890190 (patch) | |
tree | b69181225de53fefc5df93dd64e6885db9d85eb0 /libsolidity/Compiler.cpp | |
parent | d2332769d3e87b3500638591c23241ebd942fbb1 (diff) | |
download | dexon-solidity-9cc7402c9583ca3bfc9fcb234443d2f90b890190.tar dexon-solidity-9cc7402c9583ca3bfc9fcb234443d2f90b890190.tar.gz dexon-solidity-9cc7402c9583ca3bfc9fcb234443d2f90b890190.tar.bz2 dexon-solidity-9cc7402c9583ca3bfc9fcb234443d2f90b890190.tar.lz dexon-solidity-9cc7402c9583ca3bfc9fcb234443d2f90b890190.tar.xz dexon-solidity-9cc7402c9583ca3bfc9fcb234443d2f90b890190.tar.zst dexon-solidity-9cc7402c9583ca3bfc9fcb234443d2f90b890190.zip |
Split external type into ecoding and interface type.
Diffstat (limited to 'libsolidity/Compiler.cpp')
-rw-r--r-- | libsolidity/Compiler.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libsolidity/Compiler.cpp b/libsolidity/Compiler.cpp index 969c8f74..21eab230 100644 --- a/libsolidity/Compiler.cpp +++ b/libsolidity/Compiler.cpp @@ -280,15 +280,13 @@ void Compiler::appendCalldataUnpacker(TypePointers const& _typeParameters, bool // Retain the offset pointer as base_offset, the point from which the data offsets are computed. m_context << eth::Instruction::DUP1; - for (TypePointer const& type: _typeParameters) + for (TypePointer const& parameterType: _typeParameters) { // stack: v1 v2 ... v(k-1) base_offset current_offset - switch (type->category()) - { - case Type::Category::Array: + TypePointer type = parameterType->encodingType(); + if (type->category() == Type::Category::Array) { auto const& arrayType = dynamic_cast<ArrayType const&>(*type); - solAssert(arrayType.location() != DataLocation::Storage, ""); solAssert(!arrayType.baseType()->isDynamicallySized(), "Nested arrays not yet implemented."); if (_fromMemory) { @@ -344,7 +342,8 @@ void Compiler::appendCalldataUnpacker(TypePointers const& _typeParameters, bool } break; } - default: + else + { solAssert(!type->isDynamicallySized(), "Unknown dynamically sized type: " + type->toString()); CompilerUtils(m_context).loadFromMemoryDynamic(*type, !_fromMemory, true); CompilerUtils(m_context).moveToStackTop(1 + type->sizeOnStack()); |