||
(pCurDeclMD->MightHaveName(targetNameHash)
// This is done last since it is the most expensive of the IF statement.
- && StrCompFunc(pszName, pCurDeclMD->GetName()) == 0)
+ && StrCompFunc(pszName, pCurDeclMD->GetNameThrowing()) == 0)
)
{
if (CompareMethodSigWithCorrectSubstitution(pSignature, cSignature, pModule, pCurDeclMD, pDefSubst, pMT))
FORBID_FAULT;
SUPPORTS_DAC;
}
- CONTRACTL_END
+ CONTRACTL_END;
return AppDomain::GetCurrentDomain();
}
#endif //!DACCESS_COMPILE
+
+//*******************************************************************************
+LPCUTF8 MethodDesc::GetNameThrowing()
+{
+ CONTRACTL
+ {
+ THROWS;
+ }
+ CONTRACTL_END;
+
+ LPCUTF8 result = GetName();
+ if (result == NULL)
+ {
+ ThrowHR(COR_E_BADIMAGEFORMAT, BFA_METADATA_CORRUPT);
+ }
+ return result;
+}
+
//*******************************************************************************
LPCUTF8 MethodDesc::GetName(USHORT slot)
{
GC_NOTRIGGER;
FORBID_FAULT;
SUPPORTS_DAC;
- }CONTRACTL_END;
+ }
+ CONTRACTL_END;
if (IsArray())
{
LPCUTF8 GetName(USHORT slot);
+ LPCUTF8 GetNameThrowing();
+
BOOL MightHaveName(ULONG nameHashValue);
FORCEINLINE LPCUTF8 GetNameOnNonArrayClass()