Implemented events with indexed function as parameter in Yul

This commit is contained in:
Harikrishnan Mulackal
2020-09-30 12:11:39 +02:00
parent 3970412422
commit fd02ccc68c
2 changed files with 32 additions and 13 deletions
@@ -929,6 +929,20 @@ void IRGeneratorForStatements::endVisit(FunctionCall const& _functionCall)
"(" <<
IRVariable(arg).commaSeparatedList() <<
")";
else if (auto functionType = dynamic_cast<FunctionType const*>(paramTypes[i]))
{
solAssert(
IRVariable(arg).type() == *functionType &&
functionType->kind() == FunctionType::Kind::External &&
!functionType->bound(),
""
);
define(indexedArgs.emplace_back(m_context.newYulVariable(), *TypeProvider::fixedBytes(32))) <<
m_utils.combineExternalFunctionIdFunction() <<
"(" <<
IRVariable(arg).commaSeparatedList() <<
")\n";
}
else
indexedArgs.emplace_back(convert(arg, *paramTypes[i]));
}