aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-11-17 00:09:09 +0800
committerchriseth <c@ethdev.com>2015-11-17 00:09:09 +0800
commita35f91816b410a51c8d2759a90a67605b3f3b5b0 (patch)
treecff92fb5e21bad1ee963d50a8bb7c2bfd7f621d4 /libsolidity/codegen
parentc881d103b26ff80ddfe6bfcea186bdca46a27d30 (diff)
downloaddexon-solidity-a35f91816b410a51c8d2759a90a67605b3f3b5b0.tar.gz
dexon-solidity-a35f91816b410a51c8d2759a90a67605b3f3b5b0.tar.zst
dexon-solidity-a35f91816b410a51c8d2759a90a67605b3f3b5b0.zip
Fix dynamic indexed event arguments - applies sha3.
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 3774e731..3906a897 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -587,11 +587,24 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
{
++numIndexed;
arguments[arg - 1]->accept(*this);
- utils().convertType(
- *arguments[arg - 1]->annotation().type,
- *function.parameterTypes()[arg - 1],
- true
- );
+ if (auto const& arrayType = dynamic_pointer_cast<ArrayType const>(function.parameterTypes()[arg - 1]))
+ {
+ utils().fetchFreeMemoryPointer();
+ utils().encodeToMemory(
+ {arguments[arg - 1]->annotation().type},
+ {arrayType},
+ false,
+ true
+ );
+ utils().toSizeAfterFreeMemoryPointer();
+ m_context << eth::Instruction::SHA3;
+ }
+ else
+ utils().convertType(
+ *arguments[arg - 1]->annotation().type,
+ *function.parameterTypes()[arg - 1],
+ true
+ );
}
if (!event.isAnonymous())
{