Ensure the canonical MethodTable is always used.
{
NOTHROW;
GC_NOTRIGGER;
- MODE_PREEMPTIVE;
+ MODE_ANY;
}
CONTRACTL_END
return m_mainMD;
}
- MethodTable *pMT = m_typeIteratorEntry->GetTypeHandle().GetMethodTable();
+ MethodTable *pMT = m_typeIteratorEntry->GetTypeHandle().GetMethodTable()->GetCanonicalMethodTable();
PREFIX_ASSUME(pMT != NULL);
- _ASSERTE(pMT);
-
- return pMT->GetMethodDescForSlot(m_mainMD->GetSlot());
+ return pMT->GetParallelMethodDesc(m_mainMD);
}
-// Initialize the iterator. It will cover generics + prejitted;
-// but it is not EnC aware.
void
LoadedMethodDescIterator::Start(
AppDomain * pAppDomain,
GC_NOTRIGGER;
MODE_ANY;
PRECONDITION(pMT != NULL);
+ PRECONDITION(pMT->IsCanonicalMethodTable());
PRECONDITION(pDefMD != NULL);
PRECONDITION(pDefMD->IsEnCAddedMethod());
PRECONDITION(pDefMD->GetSlot() == MethodTable::NO_SLOT);
REFLECTCLASSBASEREF refType = (REFLECTCLASSBASEREF)ObjectToOBJECTREF(pTypeUNSAFE);
TypeHandle instType = refType->GetType();
- MethodDesc* pMDescInCanonMT = instType.GetMethodTable()->GetParallelMethodDesc(pMethod);
+ MethodTable* pCanonMT = instType.GetMethodTable()->GetCanonicalMethodTable();
+ MethodDesc* pMDescInCanonMT = pCanonMT->GetParallelMethodDesc(pMethod);
return pMDescInCanonMT;
}