aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ContractCompiler.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2016-09-17 18:20:26 +0800
committerGitHub <noreply@github.com>2016-09-17 18:20:26 +0800
commit60f432e869c3d49a0a68f707b9377335e7427159 (patch)
tree2948f0cf1215c89a58ada6b7fcd95b3aeb6d9480 /libsolidity/codegen/ContractCompiler.cpp
parent0bc8476aeaac94f44d85d72865c142ac4151967f (diff)
parent727c6fac85cb5f752525b9f2312707755577162f (diff)
downloaddexon-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/codegen/ContractCompiler.cpp')
-rw-r--r--libsolidity/codegen/ContractCompiler.cpp4
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;