diff --git a/libsolidity/codegen/ABIFunctions.cpp b/libsolidity/codegen/ABIFunctions.cpp index f4c743174..72c361c39 100644 --- a/libsolidity/codegen/ABIFunctions.cpp +++ b/libsolidity/codegen/ABIFunctions.cpp @@ -54,8 +54,6 @@ string ABIFunctions::tupleEncoder( functionName += options.toFunctionNameSuffix(); return createExternallyUsedFunction(functionName, [&]() { - solAssert(!_givenTypes.empty(), ""); - // Note that the values are in reverse due to the difference in calling semantics. Whiskers templ(R"( function (headStart ) -> tail { @@ -183,15 +181,13 @@ string ABIFunctions::tupleDecoder(TypePointers const& _types, bool _fromMemory) if (_fromMemory) functionName += "_fromMemory"; - solAssert(!_types.empty(), ""); - return createExternallyUsedFunction(functionName, [&]() { TypePointers decodingTypes; for (auto const& t: _types) decodingTypes.emplace_back(t->decodingType()); Whiskers templ(R"( - function (headStart, dataEnd) -> { + function (headStart, dataEnd) { if slt(sub(dataEnd, headStart), ) { revert(0, 0) } } @@ -242,6 +238,7 @@ string ABIFunctions::tupleDecoder(TypePointers const& _types, bool _fromMemory) headPos += dynamic ? 0x20 : decodingTypes[i]->calldataEncodedSize(); } templ("valueReturnParams", boost::algorithm::join(valueReturnParams, ", ")); + templ("arrow", valueReturnParams.empty() ? "" : "->"); templ("decodeElements", decodeElements); return templ.render();