c11/threads: correct assertion
authorEmil Velikov <emil.l.velikov@gmail.com>
Fri, 1 Aug 2014 16:39:49 +0000 (17:39 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 12 Aug 2014 22:36:05 +0000 (23:36 +0100)
We should assert when either the function or the flag pointer
is null or we'll end up with a null reference a few lines later.

Currently unused by mesa thus it has gone unnoticed.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
include/c11/threads_win32.h

index 5298a84321d21f9ea8ee69144f700d84d997d85d..d017c31c34e98e660a8a73dd9f1ee8e73f4b2f35 100644 (file)
@@ -296,7 +296,7 @@ static void impl_tss_dtor_invoke()
 static inline void
 call_once(once_flag *flag, void (*func)(void))
 {
-    assert(!flag && !func);
+    assert(flag && func);
 #ifdef EMULATED_THREADS_USE_NATIVE_CALL_ONCE
     {
     struct impl_call_once_param param;