mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Document appendFunctionSelector
This commit is contained in:
parent
ef9a7b2144
commit
6a708b0cfe
@ -297,16 +297,20 @@ void ContractCompiler::appendFunctionSelector(ContractDefinition const& _contrac
|
|||||||
if (!functionType->isPayable() && !_contract.isLibrary())
|
if (!functionType->isPayable() && !_contract.isLibrary())
|
||||||
appendCallValueCheck();
|
appendCallValueCheck();
|
||||||
|
|
||||||
|
// Return tag is used to jump out of the function.
|
||||||
eth::AssemblyItem returnTag = m_context.pushNewTag();
|
eth::AssemblyItem returnTag = m_context.pushNewTag();
|
||||||
|
// Parameter for calldataUnpacker
|
||||||
m_context << CompilerUtils::dataStartOffset;
|
m_context << CompilerUtils::dataStartOffset;
|
||||||
appendCalldataUnpacker(functionType->parameterTypes());
|
appendCalldataUnpacker(functionType->parameterTypes());
|
||||||
m_context.appendJumpTo(m_context.functionEntryLabel(functionType->declaration()));
|
m_context.appendJumpTo(m_context.functionEntryLabel(functionType->declaration()));
|
||||||
m_context << returnTag;
|
m_context << returnTag;
|
||||||
|
// Return tag and input parameters get consumed.
|
||||||
m_context.adjustStackOffset(
|
m_context.adjustStackOffset(
|
||||||
CompilerUtils(m_context).sizeOnStack(functionType->returnParameterTypes()) -
|
CompilerUtils(m_context).sizeOnStack(functionType->returnParameterTypes()) -
|
||||||
CompilerUtils(m_context).sizeOnStack(functionType->parameterTypes()) -
|
CompilerUtils(m_context).sizeOnStack(functionType->parameterTypes()) -
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
|
// Consumes the return parameters.
|
||||||
appendReturnValuePacker(functionType->returnParameterTypes(), _contract.isLibrary());
|
appendReturnValuePacker(functionType->returnParameterTypes(), _contract.isLibrary());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user