llvm-project/libcxx/test
Hui Xie 7abbd6224b [libc++] Fix proxy iterator issues that trigger an assertion in Chromium.
Crash report:
https://bugs.chromium.org/p/chromium/issues/detail?id=1346012

The triggered assertion is related sorting with `v8::internal::AtomicSlot`.
`AtomicSlot` is a proxy iterator with a proxy type `AtomicSlot::Reference`
(see 9bcb5eb590/src/objects/slots-atomic-inl.h).

https://reviews.llvm.org/D130197 correctly spotted the issue in
`__iter_move` but doesn't actually fix the issue. The reason is that
`AtomicSlot::operator*` returns a prvalue `Reference`. After the fix in
D130197, the return type of `__iter_move` is `Reference&&`. But the
rvalue reference is bound to the temporary value returned by
`operator*`, which will be dangling after `__iter_move` returns.

The idea of the fix in this change is borrowed from C++17's move_iterator
https://timsong-cpp.github.io/cppwp/n4659/move.iterators#move.iterator-1
When the underlying reference is a prvalue, we just return it by value.

Differential Revision: https://reviews.llvm.org/D130212
2022-07-20 18:05:49 -07:00
..
configs [libcxx][AIX] Switch build compiler to clang 2022-06-13 21:45:18 -04:00
libcxx [libc++] Use uninitialized algorithms for vector 2022-07-20 22:02:14 +02:00
std [libc++] Fix proxy iterator issues that trigger an assertion in Chromium. 2022-07-20 18:05:49 -07:00
support [libc++][ranges] Implement `std::ranges::partition_{point,copy}`. 2022-07-20 11:39:07 -07:00
.clang-tidy [libc++] Add clang-tidy for the tests 2022-07-20 11:26:49 +02:00
CMakeLists.txt [libc++] Re-apply "Always build c++experimental.a"" 2022-07-19 10:44:19 -04:00
lit.cfg.py [libc++] Allow specifying custom Lit config files 2020-06-18 10:06:04 -04:00