]> granicus.if.org Git - gc/commitdiff
Fix hb_n_marks underflow in clear_fl_marks if MARK_BIT_PER_OBJ
authorIvan Maidanski <ivmai@mail.ru>
Sat, 19 Aug 2017 15:22:37 +0000 (18:22 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 29 Sep 2017 07:46:04 +0000 (10:46 +0300)
Issue #177 (bdwgc).

* mark.c [MARK_BIT_PER_OBJ] (GC_set_hdr_marks): Set hhdr->hb_n_marks
exactly to n_marks value (without a decrement by one).

mark.c

diff --git a/mark.c b/mark.c
index a03addacf2ee270cb7f40c74461b32cafbf28261..e58ed0d2f6014928f7cc63801132717414e7513b 100644 (file)
--- a/mark.c
+++ b/mark.c
@@ -172,7 +172,7 @@ GC_INNER void GC_set_hdr_marks(hdr *hhdr)
       }
 #   endif
 #   ifdef MARK_BIT_PER_OBJ
-      hhdr -> hb_n_marks = n_marks - 1;
+      hhdr -> hb_n_marks = n_marks;
 #   else
       hhdr -> hb_n_marks = HBLK_OBJS(sz);
 #   endif