From 34649600b82d23edb65c772523aafe4cb04682ed Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:01:27 -0700 Subject: [PATCH] [release/9.0] Update `MethodTable::IsDynamicStatics` and `DacpMethodTableData::bIsDynamic` to return 0/1 instead of flag value (#106643) * Update assert in GetMethodTableData for cDAC/DAC bIsDynamic values * Make DAC return TRUE/FALSE instead of flag value for DacpMethodTableData::bIsDynamic * Make MethodTable::IsDynamicStatics return 0/1 instead of flag value --------- Co-authored-by: Elinor Fung --- src/coreclr/debug/daccess/request.cpp | 2 +- src/coreclr/vm/methodtable.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coreclr/debug/daccess/request.cpp b/src/coreclr/debug/daccess/request.cpp index 71c9df21dfa76..2f9636c67021a 100644 --- a/src/coreclr/debug/daccess/request.cpp +++ b/src/coreclr/debug/daccess/request.cpp @@ -2160,7 +2160,7 @@ ClrDataAccess::GetMethodTableDataImpl(CLRDATA_ADDRESS mt, struct DacpMethodTable MTData->dwAttrClass = pMT->GetAttrClass(); MTData->bContainsPointers = pMT->ContainsGCPointers(); MTData->bIsShared = FALSE; - MTData->bIsDynamic = pMT->IsDynamicStatics(); + MTData->bIsDynamic = pMT->IsDynamicStatics() ? TRUE : FALSE; } return S_OK; } diff --git a/src/coreclr/vm/methodtable.h b/src/coreclr/vm/methodtable.h index 751ec9d0855dd..79334cb03201f 100644 --- a/src/coreclr/vm/methodtable.h +++ b/src/coreclr/vm/methodtable.h @@ -2567,10 +2567,10 @@ class MethodTable inline PTR_BYTE GetNonGCThreadStaticsBasePointer(PTR_Thread pThread); inline PTR_BYTE GetGCThreadStaticsBasePointer(PTR_Thread pThread); - inline DWORD IsDynamicStatics() + inline BOOL IsDynamicStatics() { LIMITED_METHOD_DAC_CONTRACT; - return GetFlag(enum_flag_DynamicStatics); + return GetFlag(enum_flag_DynamicStatics) == enum_flag_DynamicStatics; } inline void SetDynamicStatics()