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: v8.0.0~1068 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b58fa8356f77f64e9525e745d090108c20a528e;p=platform%2Fupstream%2Flibgc.git 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 1225217..7cd5775 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;