mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
More safeguards for (library) function types.
This commit is contained in:
parent
2ed793c4d3
commit
455345871d
@ -2924,6 +2924,17 @@ string FunctionType::externalSignature() const
|
|||||||
{
|
{
|
||||||
solAssert(m_declaration != nullptr, "External signature of function needs declaration");
|
solAssert(m_declaration != nullptr, "External signature of function needs declaration");
|
||||||
solAssert(!m_declaration->name().empty(), "Fallback function has no signature.");
|
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();
|
bool const inLibrary = dynamic_cast<ContractDefinition const&>(*m_declaration->scope()).isLibrary();
|
||||||
FunctionTypePointer external = interfaceFunctionType();
|
FunctionTypePointer external = interfaceFunctionType();
|
||||||
|
@ -1164,18 +1164,18 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
|
|||||||
solAssert(false, "event not found");
|
solAssert(false, "event not found");
|
||||||
// no-op, because the parent node will do the job
|
// no-op, because the parent node will do the job
|
||||||
break;
|
break;
|
||||||
|
case FunctionType::Kind::DelegateCall:
|
||||||
|
_memberAccess.expression().accept(*this);
|
||||||
|
m_context << funType->externalIdentifier();
|
||||||
|
break;
|
||||||
|
case FunctionType::Kind::CallCode:
|
||||||
case FunctionType::Kind::External:
|
case FunctionType::Kind::External:
|
||||||
case FunctionType::Kind::Creation:
|
case FunctionType::Kind::Creation:
|
||||||
case FunctionType::Kind::DelegateCall:
|
|
||||||
case FunctionType::Kind::CallCode:
|
|
||||||
case FunctionType::Kind::Send:
|
case FunctionType::Kind::Send:
|
||||||
case FunctionType::Kind::BareCall:
|
case FunctionType::Kind::BareCall:
|
||||||
case FunctionType::Kind::BareCallCode:
|
case FunctionType::Kind::BareCallCode:
|
||||||
case FunctionType::Kind::BareDelegateCall:
|
case FunctionType::Kind::BareDelegateCall:
|
||||||
case FunctionType::Kind::Transfer:
|
case FunctionType::Kind::Transfer:
|
||||||
_memberAccess.expression().accept(*this);
|
|
||||||
m_context << funType->externalIdentifier();
|
|
||||||
break;
|
|
||||||
case FunctionType::Kind::Log0:
|
case FunctionType::Kind::Log0:
|
||||||
case FunctionType::Kind::Log1:
|
case FunctionType::Kind::Log1:
|
||||||
case FunctionType::Kind::Log2:
|
case FunctionType::Kind::Log2:
|
||||||
|
Loading…
Reference in New Issue
Block a user