diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2016-09-27 20:39:44 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2016-09-27 20:39:44 +0300 |
commit | 7547c377153ddd859bef6a2dd14c42e9f12aa0be (patch) | |
tree | ba6e2b1ea848df5366e893347bb7eb4e49e0cdc7 /finalize.c | |
parent | 651c7ace5ea9fa20d60fe3a3db2627c82bb3b18b (diff) | |
download | bdwgc-7547c377153ddd859bef6a2dd14c42e9f12aa0be.tar.gz |
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).
Diffstat (limited to 'finalize.c')
-rw-r--r-- | finalize.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) { |