Allow value transfer to library functions.

This commit is contained in:
chriseth
2016-09-17 11:29:27 +02:00
parent 0bc8476aea
commit 727c6fac85
3 changed files with 21 additions and 1 deletions
+3 -1
View File
@@ -263,7 +263,9 @@ void ContractCompiler::appendFunctionSelector(ContractDefinition const& _contrac
CompilerContext::LocationSetter locationSetter(m_context, functionType->declaration());
m_context << callDataUnpackerEntryPoints.at(it.first);
if (!functionType->isPayable())
// We have to allow this for libraries, because value of the previous
// call is still visible in the delegatecall.
if (!functionType->isPayable() && !_contract.isLibrary())
{
// Throw if function is not payable but call contained ether.
m_context << Instruction::CALLVALUE;