diff options
author | chriseth <chris@ethereum.org> | 2018-08-15 23:11:43 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-08-15 23:11:43 +0800 |
commit | 455345871d286c24d393fbc9dea3d8a71f1a5b23 (patch) | |
tree | e18079b266b12516985d968b8b9a05b709bf7d6e /libsolidity/ast | |
parent | 2ed793c4d345de909332651145265a21a04e92d1 (diff) | |
download | dexon-solidity-455345871d286c24d393fbc9dea3d8a71f1a5b23.tar dexon-solidity-455345871d286c24d393fbc9dea3d8a71f1a5b23.tar.gz dexon-solidity-455345871d286c24d393fbc9dea3d8a71f1a5b23.tar.bz2 dexon-solidity-455345871d286c24d393fbc9dea3d8a71f1a5b23.tar.lz dexon-solidity-455345871d286c24d393fbc9dea3d8a71f1a5b23.tar.xz dexon-solidity-455345871d286c24d393fbc9dea3d8a71f1a5b23.tar.zst dexon-solidity-455345871d286c24d393fbc9dea3d8a71f1a5b23.zip |
More safeguards for (library) function types.
Diffstat (limited to 'libsolidity/ast')
-rw-r--r-- | libsolidity/ast/Types.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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<ContractDefinition const&>(*m_declaration->scope()).isLibrary(); FunctionTypePointer external = interfaceFunctionType(); |