aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-10-07 04:55:38 +0800
committerchriseth <c@ethdev.com>2015-10-07 04:55:45 +0800
commit0297a213feeec8b27dcfc107b29228676489f21b (patch)
treeeb477976affbb46e7b40cb296aa297acea85fba6 /libsolidity
parentd35a4b849da427629334665cc1bb931a259adac9 (diff)
downloaddexon-solidity-0297a213feeec8b27dcfc107b29228676489f21b.tar.gz
dexon-solidity-0297a213feeec8b27dcfc107b29228676489f21b.tar.zst
dexon-solidity-0297a213feeec8b27dcfc107b29228676489f21b.zip
Reject ether sent to library.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/Compiler.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libsolidity/Compiler.cpp b/libsolidity/Compiler.cpp
index 6fb09def..7ce2121e 100644
--- a/libsolidity/Compiler.cpp
+++ b/libsolidity/Compiler.cpp
@@ -260,6 +260,9 @@ void Compiler::appendFunctionSelector(ContractDefinition const& _contract)
m_context << returnTag;
appendReturnValuePacker(FunctionType(*fallback).returnParameterTypes(), _contract.isLibrary());
}
+ else if (_contract.isLibrary())
+ // Reject invalid library calls and ether sent to a library.
+ m_context.appendJumpTo(m_context.errorTag());
else
m_context << eth::Instruction::STOP; // function not found