summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2016-12-05 20:26:16 +0300
committerIvan Maidanski <ivmai@mail.ru>2016-12-05 20:26:16 +0300
commit8fc1a2ffc4bb47bf11e61864768810a9561c770b (patch)
treecac283eaa12fb3d80466f9749c4303b3a52be389
parent2de49e5af4451cb19aa58377290e8dd69974789d (diff)
downloadlibatomic_ops-8fc1a2ffc4bb47bf11e61864768810a9561c770b.tar.gz
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.
-rw-r--r--tests/test_atomic_include.template5
1 files changed, 4 insertions, 1 deletions
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) \