public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-9109] libstdc++: Fix UB in atomic_ref/wait_notify.cc [PR101761]
@ 2021-10-12 10:59 Jonathan Wakely
0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2021-10-12 10:59 UTC (permalink / raw)
To: gcc-cvs, libstdc++-cvs
https://gcc.gnu.org/g:90a4981e0951687056ec4735cfd3043b35a23502
commit r11-9109-g90a4981e0951687056ec4735cfd3043b35a23502
Author: Thomas Rodgers <rodgert@twrodgers.com>
Date: Thu Sep 16 14:42:58 2021 -0700
libstdc++: Fix UB in atomic_ref/wait_notify.cc [PR101761]
Remove UB in atomic_ref/wait_notify test.
Signed-off-by: Thomas Rodgers <trodgers@redhat.com>
libstdc++-v3/ChangeLog:
PR libstdc++/101761
* testsuite/29_atomics/atomic_ref/wait_notify.cc (test): Use
va and vb as arguments to wait/notify, remove unused bb local.
(cherry picked from commit f9f1a6efaaeeec06d5c07378734cb8eb47b976a7)
Diff:
---
libstdc++-v3/testsuite/29_atomics/atomic_ref/wait_notify.cc | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/wait_notify.cc b/libstdc++-v3/testsuite/29_atomics/atomic_ref/wait_notify.cc
index b75e27617f7..b41d1ac0bb7 100644
--- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/wait_notify.cc
+++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/wait_notify.cc
@@ -33,15 +33,14 @@ template<typename S>
if constexpr (std::atomic_ref<S>::is_always_lock_free)
{
S aa{ va };
- S bb{ vb };
std::atomic_ref<S> a{ aa };
- a.wait(bb);
+ a.wait(vb);
std::thread t([&]
{
- a.store(bb);
+ a.store(vb);
a.notify_one();
});
- a.wait(aa);
+ a.wait(va);
t.join();
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-10-12 10:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-12 10:59 [gcc r11-9109] libstdc++: Fix UB in atomic_ref/wait_notify.cc [PR101761] Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).