Some commands of SOS validate a method table in DacValidateMethodTable.
In the function, it checks whether a method table is FreeObjectMethodTable or not with GetClass() value.
However, GetClass() should not be NULL. (There is an assert in GetClass())
In this patch, it compares pMT address with g_pFreeObjectMethodTable address only.
EX_TRY
{
bIsFree = FALSE;
- EEClass *pEEClass = pMT->GetClass();
- if (pEEClass==NULL)
+ if (HOST_CDADDR(pMT) == HOST_CDADDR(g_pFreeObjectMethodTable))
{
- // Okay to have a NULL EEClass if this is a free methodtable
- CLRDATA_ADDRESS MethTableAddr = HOST_CDADDR(pMT);
- CLRDATA_ADDRESS FreeObjMethTableAddr = HOST_CDADDR(g_pFreeObjectMethodTable);
- if (MethTableAddr != FreeObjMethTableAddr)
- goto BadMethodTable;
-
bIsFree = TRUE;
}
else