* Ensure non generic method defs when using textual PGO
* Allow static profiles to contain static methods for non-delegate calls
The textual PGO format currently just describes methods by name and does
not include signature information/generic instantiations. This means we
may see various edge cases here. These particular cases would hit asserts.
// resolve call above for class-based GDV.
if ((likelyMethodAttribs & CORINFO_FLG_STATIC) != 0)
{
- assert(call->IsDelegateInvoke());
+ assert((fgPgoSource != ICorJitInfo::PgoSource::Dynamic) || call->IsDelegateInvoke());
JITDUMP("Cannot currently handle devirtualizing static delegate calls, sorry\n");
return;
}
if (!th.IsNull())
{
MethodDesc* pMD = MemberLoader::FindMethodByName(th.GetMethodTable(), methodString.GetUTF8());
- newPtr = (INT_PTR)pMD;
+ if (pMD != nullptr && !pMD->IsGenericMethodDefinition())
+ {
+ newPtr = (INT_PTR)pMD;
+ }
}
}
}