From cdd2251796e8cbebde8bfd8bb9e8c67fba7091a2 Mon Sep 17 00:00:00 2001 From: Andrew Au Date: Fri, 8 Oct 2021 10:11:48 -0700 Subject: [PATCH] Fix GetGenerationWithRange when we have a gen 2 object in the ephemeral segment --- src/coreclr/gc/gc.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index 2ae2be2d8a6a4e..32943d2439738b 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -43371,6 +43371,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)); }