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 <[email protected]>
---
 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

_______________________________________________
waffle mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/waffle

Reply via email to