From: Ivan Maidanski Date: Sat, 10 Dec 2016 07:14:39 +0000 (+0300) Subject: Fix assertion in GC_steal_mark_stack for non-heap regions X-Git-Tag: v7.4.6~184 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8f35a9ee81cffc01f1fe93bea6b4e00c4495058b;p=gc Fix assertion in GC_steal_mark_stack for non-heap regions (similar to commit da2fcda) * mark.c (GC_steal_mark_stack): Replace top->mse_descr.w with descr in assertion; relax assertion condition for descr (length-containing mse_descr.w could be larger than the current GC heap size if mse_start points to a region in a stack or a program data root; e.g. it could happen if MemorySanitizer is used). --- diff --git a/mark.c b/mark.c index 00381188..1003c76f 100644 --- a/mark.c +++ b/mark.c @@ -936,9 +936,13 @@ STATIC mse * GC_steal_mark_stack(mse * low, mse * high, mse * local, ++top; top -> mse_descr.w = descr; top -> mse_start = p -> mse_start; - GC_ASSERT((top->mse_descr.w & GC_DS_TAGS) != GC_DS_LENGTH || - top->mse_descr.w < (word)GC_greatest_plausible_heap_addr - - (word)GC_least_plausible_heap_addr); + GC_ASSERT((descr & GC_DS_TAGS) != GC_DS_LENGTH + || descr < (word)GC_greatest_plausible_heap_addr + - (word)GC_least_plausible_heap_addr + || (word)(p->mse_start + descr) + <= (word)GC_least_plausible_heap_addr + || (word)p->mse_start + >= (word)GC_greatest_plausible_heap_addr); /* If this is a big object, count it as */ /* size/256 + 1 objects. */ ++i;