[libcxx-commits] [PATCH] D88849: [libc++] Make sure __clear_and_shrink() maintains string invariants
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 7 06:17:11 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG602c193e2aeb: [libc++] Make sure __clear_and_shrink() maintains string invariants (authored by ldionne).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88849/new/
https://reviews.llvm.org/D88849
Files:
libcxx/include/string
Index: libcxx/include/string
===================================================================
--- libcxx/include/string
+++ libcxx/include/string
@@ -3941,7 +3941,7 @@
return false;
if (data() == 0)
return false;
- if (data()[size()] != value_type(0))
+ if (data()[size()] != value_type())
return false;
return true;
}
@@ -3959,6 +3959,7 @@
__alloc_traits::deallocate(__alloc(), __get_long_pointer(), capacity() + 1);
__set_long_cap(0);
__set_short_size(0);
+ traits_type::assign(*__get_short_pointer(), value_type());
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88849.296655.patch
Type: text/x-patch
Size: 612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201007/d96b115c/attachment.bin>
More information about the libcxx-commits
mailing list