From 6edd12dd279de29d2dd781ba2b489eff7f6f889d Mon Sep 17 00:00:00 2001 From: Dong-Heon Jung Date: Tue, 24 Dec 2019 04:11:43 +0900 Subject: 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. --- src/debug/daccess/request.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src') diff --git a/src/debug/daccess/request.cpp b/src/debug/daccess/request.cpp index 3c40557fd0..0694b1ecbe 100644 --- a/src/debug/daccess/request.cpp +++ b/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 -- cgit v1.2.3