]> 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>
Sat, 17 Dec 2016 06:57:34 +0000 (09:57 +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 6db0bb0118e6d053ca8a69038fe3939fd4774874..dec761b9e4f7a6ede11efb33dd36d5337977b88b 100644 (file)
--- a/mark.c
+++ b/mark.c
@@ -727,7 +727,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) {