diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index 1932132867aa97..e2ce9b5bbe2b9d 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -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)); }