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)); }