From: Vladimir Sadov Date: Tue, 12 Nov 2019 15:02:02 +0000 (-0800) Subject: Fixing an assert in card stealing. (dotnet/coreclr#27822) X-Git-Tag: submit/tizen/20210909.063632~11030^2~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=793721ba2c528eeae16de0378eda104b723476c2;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fixing an assert in card stealing. (dotnet/coreclr#27822) * Fixing an assert in card stealing. * use ifdef to be consistent with other cases in the file * PR feedback Commit migrated from https://github.com/dotnet/coreclr/commit/7aa67a90a682cf885ebab8e450eb845356cd2f1d --- diff --git a/src/coreclr/src/gc/gc.cpp b/src/coreclr/src/gc/gc.cpp index be21bfd..269f99b 100644 --- a/src/coreclr/src/gc/gc.cpp +++ b/src/coreclr/src/gc/gc.cpp @@ -30474,8 +30474,13 @@ bool card_marking_enumerator::move_next(heap_segment* seg, uint8_t*& low, uint8_ { // we found the correct segment, but it's not the segment our caller is in - // our caller should still be in the previous segment - assert(heap_segment_next_in_range(seg) == segment); + // our caller should still be in one of the previous segments +#ifdef _DEBUG + for (heap_segment* cur_seg = seg; cur_seg != segment; cur_seg = heap_segment_next_in_range(cur_seg)) + { + assert(cur_seg); + } +#endif //_DEBUG // keep the chunk index for later old_chunk_index = chunk_index;