aboutsummaryrefslogtreecommitdiffstats
path: root/Compiler.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-10 01:46:18 +0800
committerChristian <c@ethdev.com>2014-12-10 23:30:20 +0800
commit130ff85e85de3ea8a9666f84843428a3a09b1aab (patch)
treeafff06eddf204678b099dc9fae187a697e8debcc /Compiler.cpp
parente8b7d266641175039d40c344449409a60527156e (diff)
downloaddexon-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.cpp6
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;