diff options
author | chriseth <chris@ethereum.org> | 2018-08-16 20:38:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-16 20:38:44 +0800 |
commit | c274af077040a726fd63764ef13319078b686968 (patch) | |
tree | 62c69295b13e0eb5fa0311e490b8a40e54e30415 /libsolidity/ast | |
parent | a9e7ae2954550409eac09f1e8f656561cf75a12a (diff) | |
parent | 455345871d286c24d393fbc9dea3d8a71f1a5b23 (diff) | |
download | dexon-solidity-c274af077040a726fd63764ef13319078b686968.tar dexon-solidity-c274af077040a726fd63764ef13319078b686968.tar.gz dexon-solidity-c274af077040a726fd63764ef13319078b686968.tar.bz2 dexon-solidity-c274af077040a726fd63764ef13319078b686968.tar.lz dexon-solidity-c274af077040a726fd63764ef13319078b686968.tar.xz dexon-solidity-c274af077040a726fd63764ef13319078b686968.tar.zst dexon-solidity-c274af077040a726fd63764ef13319078b686968.zip |
Merge pull request #4825 from ethereum/expressionCompBareCall
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 ccf31543..b1cd15b4 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -2929,6 +2929,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(); |