From 793721ba2c528eeae16de0378eda104b723476c2 Mon Sep 17 00:00:00 2001 From: Vladimir Sadov Date: Tue, 12 Nov 2019 07:02:02 -0800 Subject: [PATCH] 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 --- src/coreclr/src/gc/gc.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; -- 2.7.4