Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10717,6 +10717,14 @@ size_t gc_heap::sort_mark_list()
size_t region_index = get_basic_region_index_for_address (heap_segment_mem (region));
uint8_t* region_limit = heap_segment_allocated (region);

// Due to GC holes, x can point to something in a region that already got freed. And that region's
// allocated would be 0 and cause an infinite loop which is much harder to handle on production than
// simply throwing an exception.
if (region_limit == 0)
{
FATAL_GC_ERROR();
}

uint8_t*** mark_list_piece_start_ptr = &mark_list_piece_start[region_index];
uint8_t*** mark_list_piece_end_ptr = &mark_list_piece_end[region_index];
#else // USE_REGIONS
Expand Down