[libcxx-commits] [PATCH] D115598: [libc++][NFC] Remove goto from std::string

Nilay Vaish via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Dec 12 11:01:30 PST 2021


nilayvaish added inline comments.


================
Comment at: libcxx/include/string:1698-1699
+    void __finish_replace(size_type& __sz, size_type& __n1, size_type& __n2, value_type*& __p) {
+      // __sz += __n2 - __n1; in this and the below function below can cause unsigned
+      // integer overflow, but this is a safe operation, so we disable the check.
+      __sz += __n2 - __n1;
----------------
Quuxplusone wrote:
> This comment seems obsolete; I have no idea what "check" it's talking about. Let's remove the comment.
Maybe the UBSAN annotation on line 2988 and 3038.  I am guessing this will get sanitizer's attention now.  Should we annotate this function with  _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115598/new/

https://reviews.llvm.org/D115598



More information about the libcxx-commits mailing list