diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-06-28 23:55:20 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-06-29 00:00:40 +0800 |
commit | 6a708b0cfe245499f85f7260f7267b399c9a7fcb (patch) | |
tree | f6fdd75c1022793a4d0f39863a1bb782469e9c11 /libsolidity | |
parent | ef9a7b2144993e097da6bde7675abd5651bf64cc (diff) | |
download | dexon-solidity-6a708b0cfe245499f85f7260f7267b399c9a7fcb.tar.gz dexon-solidity-6a708b0cfe245499f85f7260f7267b399c9a7fcb.tar.zst dexon-solidity-6a708b0cfe245499f85f7260f7267b399c9a7fcb.zip |
Document appendFunctionSelector
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/codegen/ContractCompiler.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index b6352b39..74b07d4d 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -297,16 +297,20 @@ void ContractCompiler::appendFunctionSelector(ContractDefinition const& _contrac if (!functionType->isPayable() && !_contract.isLibrary()) appendCallValueCheck(); + // 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()); m_context.appendJumpTo(m_context.functionEntryLabel(functionType->declaration())); m_context << returnTag; + // Return tag and input parameters get consumed. m_context.adjustStackOffset( CompilerUtils(m_context).sizeOnStack(functionType->returnParameterTypes()) - CompilerUtils(m_context).sizeOnStack(functionType->parameterTypes()) - 1 ); + // Consumes the return parameters. appendReturnValuePacker(functionType->returnParameterTypes(), _contract.isLibrary()); } } |