From: Ivan Maidanski Date: Wed, 26 Oct 2016 21:38:55 +0000 (+0300) Subject: Workaround 'possible null pointer dereference' cppcheck warning (Darwin) X-Git-Tag: v7.6.2~361 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=762bb5b62a3482be1e439001f0a689a1c2ee437d;p=gc Workaround 'possible null pointer dereference' cppcheck warning (Darwin) * darwin_stop_world.c [CPPCHECK] (GC_stack_range_for): Call ABORT if p is NULL and thread_blocked is true. --- diff --git a/darwin_stop_world.c b/darwin_stop_world.c index 88fa09f4..51085476 100644 --- a/darwin_stop_world.c +++ b/darwin_stop_world.c @@ -142,6 +142,9 @@ STATIC ptr_t GC_stack_range_for(ptr_t *phi, thread_act_t thread, GC_thread p, # endif } else if (thread_blocked) { +# if defined(CPPCHECK) + if (NULL == p) ABORT("Invalid GC_thread passed to GC_stack_range_for"); +# endif lo = p->stop_info.stack_ptr; # ifndef DARWIN_DONT_PARSE_STACK *phi = p->topOfStack;