aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-09-15 23:44:32 +0800
committerchriseth <c@ethdev.com>2016-09-17 17:29:27 +0800
commit727c6fac85cb5f752525b9f2312707755577162f (patch)
tree2948f0cf1215c89a58ada6b7fcd95b3aeb6d9480 /libsolidity/codegen
parent0bc8476aeaac94f44d85d72865c142ac4151967f (diff)
downloaddexon-solidity-727c6fac85cb5f752525b9f2312707755577162f.tar
dexon-solidity-727c6fac85cb5f752525b9f2312707755577162f.tar.gz
dexon-solidity-727c6fac85cb5f752525b9f2312707755577162f.tar.bz2
dexon-solidity-727c6fac85cb5f752525b9f2312707755577162f.tar.lz
dexon-solidity-727c6fac85cb5f752525b9f2312707755577162f.tar.xz
dexon-solidity-727c6fac85cb5f752525b9f2312707755577162f.tar.zst
dexon-solidity-727c6fac85cb5f752525b9f2312707755577162f.zip
Allow value transfer to library functions.
Diffstat (limited to 'libsolidity/codegen')
-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;