Fix GetGenerationWithRange when we have a gen 2 object in the ephemeral segment ...
authorAndrew Au <andrewau@microsoft.com>
Mon, 11 Oct 2021 06:53:06 +0000 (23:53 -0700)
committerGitHub <noreply@github.com>
Mon, 11 Oct 2021 06:53:06 +0000 (23:53 -0700)
src/coreclr/gc/gc.cpp

index 1932132867aa9778e154b38d6fc37a6d9ee3c621..e2ce9b5bbe2b9dc6b298b81fb4d66c1681fbf233 100644 (file)
@@ -43088,6 +43088,7 @@ unsigned int GCHeap::GetGenerationWithRange (Object* object, uint8_t** ppStart,
         }
         if (generation == -1)
         {
+            generation = max_generation;
             *ppStart = heap_segment_mem (hs);
             *ppAllocated = *ppReserved = generation_allocation_start (hp->generation_of (max_generation - 1));
         }