From: Ivan Maidanski Date: Mon, 5 Dec 2016 17:26:16 +0000 (+0300) Subject: Workaround 'uninitialized memory use' MemorySanitizer warning (test_atomic) X-Git-Tag: v7.6.0~147 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8fc1a2f;p=libatomic_ops Workaround 'uninitialized memory use' MemorySanitizer warning (test_atomic) * tests/test_atomic_include.template (test_atomicXX): Ensure old_w is always initialized before AO_double_storeXX; add comment about MSan false warning. --- diff --git a/tests/test_atomic_include.template b/tests/test_atomic_include.template index f665aac..a9e1895 100644 --- a/tests/test_atomic_include.template +++ b/tests/test_atomic_include.template @@ -457,9 +457,12 @@ void test_atomicXX(void) if (zz == 25) zz = 117; # endif TA_assert(zz == 117); -# if defined(AO_HAVE_double_loadXX) +# if defined(AO_HAVE_double_loadXX) || defined(AO_HAVE_double_storeXX) + /* Initialize old_w even for store to workaround MSan warning. */ old_w.AO_val1 = 3316; old_w.AO_val2 = 2921; +# endif +# if defined(AO_HAVE_double_loadXX) new_w = AO_double_loadXX(&old_w); TA_assert(new_w.AO_val1 == 3316 && new_w.AO_val2 == 2921); # elif !defined(AO_HAVE_double_load) \