mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merged in changes from chriseth/payable
This commit is contained in:
committed by
chriseth
parent
680b83b2a4
commit
962531af96
@@ -243,14 +243,6 @@ void ContractCompiler::appendFunctionSelector(ContractDefinition const& _contrac
|
||||
if (fallback)
|
||||
{
|
||||
eth::AssemblyItem returnTag = m_context.pushNewTag();
|
||||
|
||||
// Reject transaction if value is not accepted, but was received
|
||||
if (!fallback->isPayable())
|
||||
{
|
||||
m_context << Instruction::CALLVALUE;
|
||||
m_context.appendConditionalJumpTo(m_context.errorTag());
|
||||
}
|
||||
|
||||
fallback->accept(*this);
|
||||
m_context << returnTag;
|
||||
appendReturnValuePacker(FunctionType(*fallback).returnParameterTypes(), _contract.isLibrary());
|
||||
@@ -265,15 +257,14 @@ void ContractCompiler::appendFunctionSelector(ContractDefinition const& _contrac
|
||||
CompilerContext::LocationSetter locationSetter(m_context, functionType->declaration());
|
||||
|
||||
m_context << callDataUnpackerEntryPoints.at(it.first);
|
||||
eth::AssemblyItem returnTag = m_context.pushNewTag();
|
||||
|
||||
// Reject transaction if value is not accepted, but was received
|
||||
if (!functionType->isPayable())
|
||||
{
|
||||
// Throw if function is not payable but call contained ether.
|
||||
m_context << Instruction::CALLVALUE;
|
||||
m_context.appendConditionalJumpTo(m_context.errorTag());
|
||||
}
|
||||
|
||||
eth::AssemblyItem returnTag = m_context.pushNewTag();
|
||||
m_context << CompilerUtils::dataStartOffset;
|
||||
appendCalldataUnpacker(functionType->parameterTypes());
|
||||
m_context.appendJumpTo(m_context.functionEntryLabel(functionType->declaration()));
|
||||
|
||||
Reference in New Issue
Block a user