From: Ivan Maidanski Date: Tue, 27 Sep 2016 17:39:44 +0000 (+0300) Subject: Eliminate 'deref-of-null' static analyzer warning in register_finalizer X-Git-Tag: v8.0.0~1137 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7547c377153ddd859bef6a2dd14c42e9f12aa0be;p=gc Eliminate 'deref-of-null' static analyzer warning in register_finalizer * finalize.c (GC_register_finalizer_inner): Add GC_ASSERT that fn and hhdr are non-NULL (instead of specifying this in a comment) if new_fo is non-NULL (new_fo is returned by GC_oom_fn). --- diff --git a/finalize.c b/finalize.c index 8b3afa01..514e42d9 100644 --- a/finalize.c +++ b/finalize.c @@ -700,7 +700,8 @@ STATIC void GC_register_finalizer_inner(void * obj, curr_fo = fo_next(curr_fo); } if (EXPECT(new_fo != 0, FALSE)) { - /* new_fo is returned by GC_oom_fn(), so fn != 0 and hhdr != 0. */ + /* new_fo is returned by GC_oom_fn(). */ + GC_ASSERT(fn != 0 && hhdr != NULL); break; } if (fn == 0) {