diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2016-10-27 00:38:55 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2016-10-27 00:38:55 +0300 |
commit | 8b58fa8356f77f64e9525e745d090108c20a528e (patch) | |
tree | 16c054cca39f0d95796891bd8f14d96353c76e35 /darwin_stop_world.c | |
parent | 3a289296bd0feafd3d9008cb6be25fe6e0e63c76 (diff) | |
download | bdwgc-8b58fa8356f77f64e9525e745d090108c20a528e.tar.gz |
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.
Diffstat (limited to 'darwin_stop_world.c')
-rw-r--r-- | darwin_stop_world.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/darwin_stop_world.c b/darwin_stop_world.c index 1225217b..7cd5775f 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; |