[waffle] [PATCH 19/33] third_party/threads: correct assertion

Emil Velikov emil.l.velikov at gmail.com
Mon Jul 7 10:28:26 PDT 2014


We should assert when either the function or the flag (ptr)
is null as otherwise we would deref the null pointers.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 third_party/threads/threads_win32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/third_party/threads/threads_win32.c b/third_party/threads/threads_win32.c
index b67a35d..615ecb8 100644
--- a/third_party/threads/threads_win32.c
+++ b/third_party/threads/threads_win32.c
@@ -236,7 +236,7 @@ static void impl_tss_dtor_invoke()
 // 7.25.2.1
 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;
-- 
2.0.0



More information about the waffle mailing list