Workaround 'int shift by negative amount' false defect in GC_finalize
authorIvan Maidanski <ivmai@mail.ru>
Wed, 24 May 2017 08:30:42 +0000 (11:30 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 24 May 2017 08:30:42 +0000 (11:30 +0300)
(fix commits eeb118d, d46fbe0)

* finalize.c [GC_ASSERTIONS || LINT2] (GC_finalize): Replace GC_ASSERT
(for curr_fo and log_fo_table_size) with a conditional ABORT.

finalize.c

index 1d0fcdf..4b65279 100644 (file)
@@ -1049,7 +1049,10 @@ GC_INNER void GC_finalize(void)
        other finalizable objects */
       if (need_unreachable_finalization) {
         curr_fo = GC_fnlz_roots.finalize_now;
-        GC_ASSERT(NULL == curr_fo || log_fo_table_size >= 0);
+#       if defined(GC_ASSERTIONS) || defined(LINT2)
+          if (curr_fo != NULL && log_fo_table_size < 0)
+            ABORT("log_size is negative");
+#       endif
         prev_fo = NULL;
         while (curr_fo != NULL) {
           next_fo = fo_next(curr_fo);