diff options
author | chriseth <chris@ethereum.org> | 2017-06-30 20:09:35 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-06-30 20:16:16 +0800 |
commit | 71d866cd7ab8013f36ab5b01d849a74b9908aae0 (patch) | |
tree | 40e6c1ca1439cd49403e731894ac89f0191d471c /libsolidity/codegen/ContractCompiler.cpp | |
parent | 735c977db1824436d09d8e7a5c120fcab21003c3 (diff) | |
download | dexon-solidity-71d866cd7ab8013f36ab5b01d849a74b9908aae0.tar.gz dexon-solidity-71d866cd7ab8013f36ab5b01d849a74b9908aae0.tar.zst dexon-solidity-71d866cd7ab8013f36ab5b01d849a74b9908aae0.zip |
Abort early if there is nothing to encode or decode.
Diffstat (limited to 'libsolidity/codegen/ContractCompiler.cpp')
-rw-r--r-- | libsolidity/codegen/ContractCompiler.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index 74b07d4d..c358a519 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -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. |