Abort early if there is nothing to encode or decode.

This commit is contained in:
chriseth committed 2017-06-30 14:16:16 +02:00
1 parent 735c977db1
commit 71d866cd7a
2 files changed
+9 -3

No files matched your search

+6 -3
View File
@@ -299,9 +299,12 @@ void ContractCompiler::appendFunctionSelector(ContractDefinition const& _contrac
// Return tag is used to jump out of the function.
eth::AssemblyItem returnTag = m_context.pushNewTag();
// Parameter for calldataUnpacker
m_context << CompilerUtils::dataStartOffset;
appendCalldataUnpacker(functionType->parameterTypes());
if (!functionType->parameterTypes().empty())
{
// Parameter for calldataUnpacker
m_context << CompilerUtils::dataStartOffset;
appendCalldataUnpacker(functionType->parameterTypes());
}
m_context.appendJumpTo(m_context.functionEntryLabel(functionType->declaration()));
m_context << returnTag;
// Return tag and input parameters get consumed.