Fix dynamic indexed event arguments - applies sha3.

This commit is contained in:
chriseth committed 2015-11-16 17:09:09 +01:00
1 parent c881d103b2
commit a35f91816b
2 files changed
+53 -5

No files matched your search

+18 -5
View File
@@ -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())
{