Use DispatchToken::CreateDispatchToken to get token to resolve
virtual method in case of non interface MT.
DispatchToken token;
if (pMT->IsInterface() || MethodTable::VTableIndir_t::isRelative)
{
- token = pMT->GetLoaderAllocator()->GetDispatchToken(pMT->GetTypeID(), slot);
+ if (pMT->IsInterface())
+ token = pMT->GetLoaderAllocator()->GetDispatchToken(pMT->GetTypeID(), slot);
+ else
+ token = DispatchToken::CreateDispatchToken(slot);
+
StubCallSite callSite(pIndirection, pEMFrame->GetReturnAddress());
pCode = pMgr->ResolveWorker(&callSite, protectedObj, token, VirtualCallStubManager::SK_LOOKUP);
}