Skip to content

Commit c093bb8

Browse files
authored
need to check if the child obj is on an ro region (#67729)
when we check if a card is needed, we need to check if the child obj is in an ro region before getting its gen_num since there's no region data structure for it.
1 parent 1a31bf6 commit c093bb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/coreclr/gc/gc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43062,7 +43062,7 @@ BOOL gc_heap::check_need_card (uint8_t* child_obj, int gen_num_for_cards,
4306243062
uint8_t* low, uint8_t* high)
4306343063
{
4306443064
#ifdef USE_REGIONS
43065-
return (get_region_gen_num (child_obj) < gen_num_for_cards);
43065+
return (is_in_heap_range (child_obj) && (get_region_gen_num (child_obj) < gen_num_for_cards));
4306643066
#else
4306743067
return ((child_obj < high) && (child_obj >= low));
4306843068
#endif //USE_REGIONS

0 commit comments

Comments
 (0)