@@ -10596,7 +10596,7 @@ static int __cdecl cmp_mark_list_item (const void* vkey, const void* vdatum)
10596
10596
#endif // _DEBUG
10597
10597
10598
10598
#ifdef USE_REGIONS
10599
- uint8_t** gc_heap::get_region_mark_list (uint8_t* start, uint8_t* end, uint8_t*** mark_list_end_ptr)
10599
+ uint8_t** gc_heap::get_region_mark_list (BOOL& use_mark_list, uint8_t* start, uint8_t* end, uint8_t*** mark_list_end_ptr)
10600
10600
{
10601
10601
size_t region_number = get_basic_region_index_for_address (start);
10602
10602
size_t source_number = region_number;
@@ -10726,6 +10726,13 @@ void gc_heap::merge_mark_lists (size_t total_mark_list_size)
10726
10726
10727
10727
// blast this piece to the mark list
10728
10728
append_to_mark_list(source[lowest_source], x);
10729
+ #ifdef USE_REGIONS
10730
+ if (mark_list_index > mark_list_end)
10731
+ {
10732
+ use_mark_list = false;
10733
+ return nullptr;
10734
+ }
10735
+ #endif //USE_REGIONS
10729
10736
piece_count++;
10730
10737
10731
10738
source[lowest_source] = x;
@@ -10745,6 +10752,13 @@ void gc_heap::merge_mark_lists (size_t total_mark_list_size)
10745
10752
}
10746
10753
// we're left with just one source that we copy
10747
10754
append_to_mark_list(source[0], source_end[0]);
10755
+ #ifdef USE_REGIONS
10756
+ if (mark_list_index > mark_list_end)
10757
+ {
10758
+ use_mark_list = false;
10759
+ return nullptr;
10760
+ }
10761
+ #endif //USE_REGIONS
10748
10762
piece_count++;
10749
10763
}
10750
10764
@@ -10801,7 +10815,7 @@ static uint8_t** binary_search (uint8_t** left, uint8_t** right, uint8_t* e)
10801
10815
return a + l;
10802
10816
}
10803
10817
10804
- uint8_t** gc_heap::get_region_mark_list (uint8_t* start, uint8_t* end, uint8_t*** mark_list_end_ptr)
10818
+ uint8_t** gc_heap::get_region_mark_list (BOOL& use_mark_list, uint8_t* start, uint8_t* end, uint8_t*** mark_list_end_ptr)
10805
10819
{
10806
10820
// do a binary search over the sorted marked list to find start and end of the
10807
10821
// mark list for this region
@@ -31610,7 +31624,7 @@ void gc_heap::plan_phase (int condemned_gen_number)
31610
31624
uint8_t** mark_list_index = nullptr;
31611
31625
uint8_t** mark_list_next = nullptr;
31612
31626
if (use_mark_list)
31613
- mark_list_next = get_region_mark_list (x, end, &mark_list_index);
31627
+ mark_list_next = get_region_mark_list (use_mark_list, x, end, &mark_list_index);
31614
31628
#else // USE_REGIONS
31615
31629
assert (!marked (x));
31616
31630
uint8_t** mark_list_next = &mark_list[0];
@@ -31898,7 +31912,7 @@ void gc_heap::plan_phase (int condemned_gen_number)
31898
31912
current_brick = brick_of (x);
31899
31913
#ifdef USE_REGIONS
31900
31914
if (use_mark_list)
31901
- mark_list_next = get_region_mark_list (x, end, &mark_list_index);
31915
+ mark_list_next = get_region_mark_list (use_mark_list, x, end, &mark_list_index);
31902
31916
31903
31917
if (should_sweep_in_plan (seg1))
31904
31918
{
@@ -31968,7 +31982,7 @@ void gc_heap::plan_phase (int condemned_gen_number)
31968
31982
current_brick = brick_of (x);
31969
31983
31970
31984
if (use_mark_list)
31971
- mark_list_next = get_region_mark_list (x, end, &mark_list_index);
31985
+ mark_list_next = get_region_mark_list (use_mark_list, x, end, &mark_list_index);
31972
31986
31973
31987
if (should_sweep_in_plan (seg1))
31974
31988
{
0 commit comments