Fix verifyheap for objects larger than 4GB (#2244)
authorJan Kotas <jkotas@microsoft.com>
Tue, 4 May 2021 21:58:34 +0000 (14:58 -0700)
committerGitHub <noreply@github.com>
Tue, 4 May 2021 21:58:34 +0000 (14:58 -0700)
Fixes https://github.com/dotnet/runtime/issues/52233

src/SOS/Strike/eeheap.cpp
src/SOS/Strike/gcroot.cpp
src/SOS/Strike/util.h

index be5e69b5183c56014d033f9c5c5a37ccccfe6a69..9651fe234bfe38f2bd05a23bd6ba709c70a40429 100644 (file)
@@ -1079,7 +1079,7 @@ BOOL GCHeapUsageStats(const GCHeapDetails& heap, BOOL bIncUnreachable, HeapUsage
     return TRUE;
 }
 
-DWORD GetNumComponents(TADDR obj)
+size_t GetNumComponents(TADDR obj)
 {
     // The number of components is always the second pointer in the object.
     DWORD Value = NULL;
index 38c64ce4a1e85daaa58efe50a75894c56d81df76..aeaa6bfe938064857f0cca94861bc6c32c4eb250 100644 (file)
@@ -1072,7 +1072,7 @@ GCRootImpl::RootNode *GCRootImpl::GetGCRefs(RootNode *path, RootNode *node)
     return refs;
 }
 
-DWORD GCRootImpl::GetComponents(TADDR obj, TADDR mt)
+size_t GCRootImpl::GetComponents(TADDR obj, TADDR mt)
 {
     // Get the number of components in the object (for arrays and such).
     DWORD Value = 0;
@@ -1099,7 +1099,7 @@ size_t GCRootImpl::GetSizeOfObject(TADDR obj, MTInfo *info)
     {
         // this is an array, so the size has to include the size of the components. We read the number
         // of components from the target and multiply by the component size to get the size.
-        DWORD components = GetComponents(obj, info->MethodTable);
+        size_t components = GetComponents(obj, info->MethodTable);
         res += info->ComponentSize * components;
     }
 
index 277b502741f5a6df6413b7f8fc9c6820c77a12fa..638d50d0bcba8c55d00ea6c4a35139b4fafc6d0b 100644 (file)
@@ -1806,7 +1806,7 @@ DWORD_PTR LoaderHeapInfo(CLRDATA_ADDRESS pLoaderHeapAddr, DWORD_PTR *wasted = 0)
 DWORD_PTR JitHeapInfo();
 DWORD_PTR VSDHeapInfo(CLRDATA_ADDRESS appDomain, DWORD_PTR *wasted = 0);
 
-DWORD GetNumComponents(TADDR obj);
+size_t GetNumComponents(TADDR obj);
 
 struct GenUsageStat
 {
@@ -3183,7 +3183,7 @@ private:
 
     // Object/MT data:
     MTInfo *GetMTInfo(TADDR mt);
-    DWORD GetComponents(TADDR obj, TADDR mt);
+    size_t GetComponents(TADDR obj, TADDR mt);
     size_t GetSizeOfObject(TADDR obj, MTInfo *info);
 
     // RootNode management: