diff options
author | Christian <c@ethdev.com> | 2014-12-10 01:46:18 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-12-10 23:30:20 +0800 |
commit | 130ff85e85de3ea8a9666f84843428a3a09b1aab (patch) | |
tree | afff06eddf204678b099dc9fae187a697e8debcc /Compiler.cpp | |
parent | e8b7d266641175039d40c344449409a60527156e (diff) | |
download | dexon-solidity-130ff85e85de3ea8a9666f84843428a3a09b1aab.tar dexon-solidity-130ff85e85de3ea8a9666f84843428a3a09b1aab.tar.gz dexon-solidity-130ff85e85de3ea8a9666f84843428a3a09b1aab.tar.bz2 dexon-solidity-130ff85e85de3ea8a9666f84843428a3a09b1aab.tar.lz dexon-solidity-130ff85e85de3ea8a9666f84843428a3a09b1aab.tar.xz dexon-solidity-130ff85e85de3ea8a9666f84843428a3a09b1aab.tar.zst dexon-solidity-130ff85e85de3ea8a9666f84843428a3a09b1aab.zip |
String types.
Diffstat (limited to 'Compiler.cpp')
-rw-r--r-- | Compiler.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Compiler.cpp b/Compiler.cpp index a8a07403..781f3680 100644 --- a/Compiler.cpp +++ b/Compiler.cpp @@ -142,6 +142,9 @@ unsigned Compiler::appendCalldataUnpacker(FunctionDefinition const& _function, b << errinfo_comment("Type " + var->getType()->toString() + " not yet supported.")); if (numBytes == 32) m_context << u256(dataOffset) << load; + else if (var->getType()->getCategory() == Type::Category::STRING) + m_context << (u256(1) << ((32 - numBytes) * 8)) << eth::Instruction::DUP1 + << u256(dataOffset) << load << eth::Instruction::DIV << eth::Instruction::MUL; else m_context << (u256(1) << ((32 - numBytes) * 8)) << u256(dataOffset) << load << eth::Instruction::DIV; @@ -166,7 +169,8 @@ void Compiler::appendReturnValuePacker(FunctionDefinition const& _function) << errinfo_comment("Type " + paramType.toString() + " not yet supported.")); CompilerUtils(m_context).copyToStackTop(stackDepth, paramType); if (numBytes != 32) - m_context << (u256(1) << ((32 - numBytes) * 8)) << eth::Instruction::MUL; + if (paramType.getCategory() != Type::Category::STRING) + m_context << (u256(1) << ((32 - numBytes) * 8)) << eth::Instruction::MUL; m_context << u256(dataOffset) << eth::Instruction::MSTORE; stackDepth -= paramType.getSizeOnStack(); dataOffset += numBytes; |