]> granicus.if.org Git - gc/commitdiff
Fix GC_push_all/selected boundaries check
authorIvan Maidanski <ivmai@mail.ru>
Thu, 16 Feb 2012 18:47:28 +0000 (22:47 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 16 Feb 2012 21:15:17 +0000 (01:15 +0400)
* 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.

mark.c

diff --git a/mark.c b/mark.c
index 434bec760da08a934b37113bfbf305e258d81019..41a7af52c3a50724c37d4bacfd2f52a77c694f0e 100644 (file)
--- a/mark.c
+++ b/mark.c
@@ -1265,7 +1265,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");
@@ -1296,7 +1297,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) {