]> granicus.if.org Git - gc/commitdiff
Workaround 'checking unsigned value is negative' code defect in mark_from
authorIvan Maidanski <ivmai@mail.ru>
Sat, 17 Dec 2016 06:57:34 +0000 (09:57 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 6 Feb 2017 17:29:53 +0000 (20:29 +0300)
* mark.c (GC_mark_from): Replace (signed_word)descr<0 with
(descr&SIGNB)!=0.

mark.c

diff --git a/mark.c b/mark.c
index dc5deaaa38e99472cd7d2ce43cf0cfecc92f6b4f..51563e9e2a4b6f5e87936d4277425d0061f80084 100644 (file)
--- a/mark.c
+++ b/mark.c
@@ -720,7 +720,7 @@ GC_INNER mse * GC_mark_from(mse *mark_stack_top, mse *mark_stack,
           descr &= ~GC_DS_TAGS;
           credit -= WORDS_TO_BYTES(WORDSZ/2); /* guess */
           while (descr != 0) {
-            if ((signed_word)descr < 0) {
+            if ((descr & SIGNB) != 0) {
               current = *(word *)current_p;
               FIXUP_POINTER(current);
               if (current >= (word)least_ha && current < (word)greatest_ha) {