From 59e156e2f133ff773dae2648d71ff0d4bd2418af Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 24 May 2017 11:30:42 +0300 Subject: [PATCH] Workaround 'int shift by negative amount' false defect in GC_finalize (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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/finalize.c b/finalize.c index 1d0fcdf..4b65279 100644 --- a/finalize.c +++ b/finalize.c @@ -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); -- 2.7.4