From: Dong-Heon Jung Date: Mon, 23 Dec 2019 19:11:43 +0000 (+0900) Subject: Change bIsFree check in DacValidateMethodTable (#1086) X-Git-Tag: submit/tizen/20210909.063632~10619 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07fa0f7f07a04e8238c63b90b208beebba108399;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Change bIsFree check in DacValidateMethodTable (#1086) 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. --- diff --git a/src/coreclr/src/debug/daccess/request.cpp b/src/coreclr/src/debug/daccess/request.cpp index fb556d5..de9790b 100644 --- a/src/coreclr/src/debug/daccess/request.cpp +++ b/src/coreclr/src/debug/daccess/request.cpp @@ -129,15 +129,8 @@ BOOL DacValidateMethodTable(MethodTable *pMT, BOOL &bIsFree) 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