Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libcxx/include/string
Original file line number Diff line number Diff line change
Expand Up @@ -919,10 +919,16 @@ public:
# else
_NOEXCEPT
# endif
#ifndef _LIBCPP_HAS_NO_ASAN
// Turning off ASan instrumentation for variable initialization with _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS
// does not work consistently during initialization of __r_, so we instead unpoison __str's memory manually first.
// __str's memory needs to be unpoisoned only in the case where it's a short string.
: __r_(((__str.__is_long() ? 0 : (__str.__annotate_delete(), 0)), std::move(__str.__r_))) {
// ASan TODO: ^ This line results in stack frame growth and isn't correctly optimized by the compiler.
// It should be refactored to improve performance.
#else
: __r_(std::move(__str.__r_)) {
#endif
__str.__r_.first() = __rep();
__str.__annotate_new(0);
if (!__is_long())
Expand Down