The exit codes are defined as ints, while we were using an bool array.
This resulted in stack corruption due to the difference of the size in
the two types.

Huge thanks to Jose for spotting this one.

Spotted-by: Jose Fonseca <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
---

This is a replacement for [PATCH 4/4] wgl: attempt to fix the final test
which was attempting to "fix" the wrong thing.

-Emil

 src/waffle/core/wcore_error_unittest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/waffle/core/wcore_error_unittest.c 
b/src/waffle/core/wcore_error_unittest.c
index 5176031..b63df3b 100644
--- a/src/waffle/core/wcore_error_unittest.c
+++ b/src/waffle/core/wcore_error_unittest.c
@@ -190,7 +190,7 @@ test_wcore_error_thread_local(void **state) {
 
     thrd_t threads[NUM_THREADS];
     struct thread_arg thread_args[NUM_THREADS];
-    bool exit_codes[NUM_THREADS];
+    int exit_codes[NUM_THREADS];
 
     mtx_init(&mutex, mtx_plain);
     cnd_init(&cond);
@@ -217,7 +217,7 @@ test_wcore_error_thread_local(void **state) {
     }
 
     for (int i = 0; i < NUM_THREADS; ++i) {
-        thrd_join(threads[i], (int *) &exit_codes[i]);
+        thrd_join(threads[i], &exit_codes[i]);
         assert_true(exit_codes[i]);
     }
 
-- 
2.0.2

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

Reply via email to