diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index 5c5970d30ef2a..e278bba5005f3 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -44690,6 +44690,13 @@ unsigned int GCHeap::GetGenerationWithRange (Object* object, uint8_t** ppStart, bool GCHeap::IsEphemeral (Object* object) { uint8_t* o = (uint8_t*)object; +#if defined(FEATURE_BASICFREEZE) && defined(USE_REGIONS) + if (!is_in_heap_range (o)) + { + // Objects in frozen segments are not ephemeral + return FALSE; + } +#endif gc_heap* hp = gc_heap::heap_of (o); return !!hp->ephemeral_pointer_p (o); }