Allow value transfer to library functions.

This commit is contained in:
chriseth committed 2016-09-17 11:29:27 +02:00
1 parent 0bc8476aea
commit 727c6fac85
3 files changed
+21 -1

No files matched your search

+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;