llvm-project/libcxx
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
..
benchmarks [libc++] Implements Unicode grapheme clustering 2022-07-20 18:38:32 +02:00
cmake [libc++] Drop the legacy debug mode symbols by default 2022-07-19 17:16:06 -04:00
docs [libc++][ranges] Implement `std::ranges::partition_{point,copy}`. 2022-07-20 11:39:07 -07:00
include [libc++] Fix proxy iterator issues that trigger an assertion in Chromium. 2022-07-20 18:05:49 -07:00
lib [libc++][NFC] Add commit SHA for ABI change 2022-07-19 17:16:53 -04:00
src [libc++] Treat incomplete features just like other experimental features 2022-07-19 10:50:20 -04:00
test [libc++] Fix proxy iterator issues that trigger an assertion in Chromium. 2022-07-20 18:05:49 -07:00
utils [libc++] Implements Unicode grapheme clustering 2022-07-20 18:38:32 +02:00
.clang-format [libcxx] Remove extraneous '---' lines in .clang-format files 2022-06-15 01:34:37 -07:00
.clang-tidy [libc++] Make parameter names consistent and enforce the naming style using readability-identifier-naming 2022-07-08 18:17:47 +02:00
.gitignore
CMakeLists.txt [libc++] Drop the legacy debug mode symbols by default 2022-07-19 17:16:06 -04:00
CREDITS.TXT Microsoft's floating-point to_chars powered by Ryu and Ryu Printf 2021-12-12 16:34:50 +01:00
LICENSE.TXT
TODO.TXT [libc++] Disallow volatile types in std::allocator 2021-09-22 11:47:38 -04:00
appveyor-reqs-install.cmd
appveyor.yml [libc++] Re-apply "Always build c++experimental.a"" 2022-07-19 10:44:19 -04:00