From 0297a213feeec8b27dcfc107b29228676489f21b Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 6 Oct 2015 22:55:38 +0200 Subject: Reject ether sent to library. --- libsolidity/Compiler.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libsolidity') 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 -- cgit v1.2.3