Provide selector for some internal functions.

This commit is contained in:
chriseth
2021-03-01 16:19:59 +01:00
parent 44493ad428
commit 5e94fce7df
5 changed files with 72 additions and 1 deletions
@@ -1689,9 +1689,15 @@ void IRGeneratorForStatements::endVisit(MemberAccess const& _memberAccess)
functionType.kind() == FunctionType::Kind::DelegateCall
)
define(IRVariable{_memberAccess}, IRVariable(_memberAccess.expression()).part("functionSelector"));
else if (functionType.kind() == FunctionType::Kind::Declaration)
else if (
functionType.kind() == FunctionType::Kind::Declaration ||
// In some situations, internal function types also provide the "selector" member.
// See Types.cpp for details.
functionType.kind() == FunctionType::Kind::Internal
)
{
solAssert(functionType.hasDeclaration(), "");
solAssert(functionType.declaration().isPartOfExternalInterface(), "");
define(IRVariable{_memberAccess}) << formatNumber(functionType.externalIdentifier() << 224) << "\n";
}
else