summaryrefslogtreecommitdiff
path: root/darwin_stop_world.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2019-02-14 23:17:36 +0300
committerIvan Maidanski <ivmai@mail.ru>2019-02-14 23:17:36 +0300
commit9aa26e0b55caf1035e362fb480b9d91265b1a5c5 (patch)
tree331d985fcbdc7a8de338e275c71dc0e84b889499 /darwin_stop_world.c
parent265c4a4fbd4e9871d65956f74315036817fd5170 (diff)
downloadbdwgc-9aa26e0b55caf1035e362fb480b9d91265b1a5c5.tar.gz
Workaround 'uninitialized variable: info' cppcheck false positive (OS X)
* darwin_stop_world.c [DEBUG_THREADS && CPPCHECK] (GC_thread_resume): Initialize info.run_state value (to 0) before thread_info() call.
Diffstat (limited to 'darwin_stop_world.c')
-rw-r--r--darwin_stop_world.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/darwin_stop_world.c b/darwin_stop_world.c
index 2872bc03..05463461 100644
--- a/darwin_stop_world.c
+++ b/darwin_stop_world.c
@@ -658,6 +658,9 @@ GC_INLINE void GC_thread_resume(thread_act_t thread)
struct thread_basic_info info;
mach_msg_type_number_t outCount = THREAD_BASIC_INFO_COUNT;
+# if defined(CPPCHECK) && defined(DEBUG_THREADS)
+ info.run_state = 0;
+# endif
kern_result = thread_info(thread, THREAD_BASIC_INFO,
(thread_info_t)&info, &outCount);
if (kern_result != KERN_SUCCESS)