From: Ivan Maidanski Date: Thu, 16 Feb 2012 18:47:28 +0000 (+0400) Subject: Fix GC_push_all/selected boundaries check X-Git-Tag: gc7_3alpha2~108 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a92b5c847c9c745e118580377af6105951a8d92f;p=gc Fix GC_push_all/selected boundaries check * mark.c (GC_push_all, GC_push_selected): Properly check for empty region after boundaries alignment (for the case when boundaries unaligned and the region is short than one word); simplify the checked condition. --- diff --git a/mark.c b/mark.c index 15e570af..62e38137 100644 --- a/mark.c +++ b/mark.c @@ -1260,7 +1260,8 @@ GC_INNER void GC_push_all(ptr_t bottom, ptr_t top) bottom = (ptr_t)(((word) bottom + ALIGNMENT-1) & ~(ALIGNMENT-1)); top = (ptr_t)(((word) top) & ~(ALIGNMENT-1)); - if (top == 0 || bottom == top) return; + if (bottom >= top) return; + GC_mark_stack_top++; if (GC_mark_stack_top >= GC_mark_stack_limit) { ABORT("Unexpected mark stack overflow"); @@ -1291,7 +1292,7 @@ GC_INNER void GC_push_all(ptr_t bottom, ptr_t top) bottom = (ptr_t)(((word) bottom + ALIGNMENT-1) & ~(ALIGNMENT-1)); top = (ptr_t)(((word) top) & ~(ALIGNMENT-1)); - if (top == 0 || bottom == top) return; + if (bottom >= top) return; h = HBLKPTR(bottom + HBLKSIZE); if (top <= (ptr_t) h) {