diff options
author | chriseth <chris@ethereum.org> | 2016-09-17 18:20:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-17 18:20:26 +0800 |
commit | 60f432e869c3d49a0a68f707b9377335e7427159 (patch) | |
tree | 2948f0cf1215c89a58ada6b7fcd95b3aeb6d9480 /libsolidity | |
parent | 0bc8476aeaac94f44d85d72865c142ac4151967f (diff) | |
parent | 727c6fac85cb5f752525b9f2312707755577162f (diff) | |
download | dexon-solidity-60f432e869c3d49a0a68f707b9377335e7427159.tar.gz dexon-solidity-60f432e869c3d49a0a68f707b9377335e7427159.tar.zst dexon-solidity-60f432e869c3d49a0a68f707b9377335e7427159.zip |
Merge pull request #1102 from ethereum/fixlibraryvalue
Allow value transfer to library functions.
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/codegen/ContractCompiler.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index 33571bc0..18b42fce 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -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; |