libstdc++: [_GLIBCXX_DEBUG] Complete deadlock fix on safe iterators [PR108288]
authorFrançois Dumont <fdumont@gcc.gnu.org>
Mon, 9 Jan 2023 17:48:30 +0000 (18:48 +0100)
committerFrançois Dumont <fdumont@gcc.gnu.org>
Sun, 15 Jan 2023 16:05:00 +0000 (17:05 +0100)
commit5c9833d878602de20043a5b74e4c6acd33d5fb3e
tree075fe8050395359716ce8aa1b9eaaa8b500d7c52
parent844190af178c210a6aff6b7eb4dd8c6a49210ff9
libstdc++: [_GLIBCXX_DEBUG] Complete deadlock fix on safe iterators [PR108288]

Complete fix on all _Safe_iterator post-increment and post-decrement implementations
and on _Safe_local_iterator.

libstdc++-v3/ChangeLog:

PR libstdc++/108288
* include/debug/safe_iterator.h (_Safe_iterator<>::operator++(int)): Extend deadlock
fix to other iterator category.
(_Safe_iterator<>::operator--(int)): Likewise.
* include/debug/safe_local_iterator.h (_Safe_local_iterator<>::operator++(int)):
Fix deadlock.
* testsuite/util/debug/unordered_checks.h (invalid_local_iterator_pre_increment): New.
(invalid_local_iterator_post_increment): New.
* testsuite/23_containers/unordered_map/debug/invalid_local_iterator_post_increment_neg.cc:
New test.
* testsuite/23_containers/unordered_map/debug/invalid_local_iterator_pre_increment_neg.cc:
New test.
libstdc++-v3/include/debug/safe_iterator.h
libstdc++-v3/include/debug/safe_local_iterator.h
libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_post_increment_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_pre_increment_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/util/debug/unordered_checks.h