From 455345871d286c24d393fbc9dea3d8a71f1a5b23 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 15 Aug 2018 17:11:43 +0200 Subject: More safeguards for (library) function types. --- libsolidity/ast/Types.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libsolidity/ast') diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index c9dca126..2fb5fba2 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -2924,6 +2924,17 @@ string FunctionType::externalSignature() const { solAssert(m_declaration != nullptr, "External signature of function needs declaration"); solAssert(!m_declaration->name().empty(), "Fallback function has no signature."); + switch (kind()) + { + case Kind::Internal: + case Kind::External: + case Kind::CallCode: + case Kind::DelegateCall: + case Kind::Event: + break; + default: + solAssert(false, "Invalid function type for requesting external signature."); + } bool const inLibrary = dynamic_cast(*m_declaration->scope()).isLibrary(); FunctionTypePointer external = interfaceFunctionType(); -- cgit