From bcd444af98d9068452652650e1690316e1cc7b80 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 7 Dec 2016 10:40:15 +0300 Subject: [PATCH] Workaround 'pointer used before comparison to null' code defect (pthread) (fix commit 31b3afc) * pthread_support.c [GC_PTHREADS && !GC_WIN32_THREADS && DEBUG_THREADS] (GC_pthread_create): Do not check new_thread is non-NULL (because new_thread is first passed to the underlying pthread_create() where the argument is marked with "nonnull" attribute). --- pthread_support.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pthread_support.c b/pthread_support.c index 86e6c44c..8ccc3e7e 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -1822,7 +1822,7 @@ GC_API int WRAP_FUNC(pthread_create)(pthread_t *new_thread, IF_CANCEL(int cancel_state;) # ifdef DEBUG_THREADS - if (new_thread) + /* new_thread is non-NULL because pthread_create requires it. */ GC_log_printf("Started thread %p\n", (void *)(*new_thread)); # endif DISABLE_CANCEL(cancel_state); -- 2.40.0