[clang-tools-extra] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

James Y Knight via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 26 10:08:29 PDT 2023


================
@@ -1969,7 +1955,8 @@ private:
                     allocator_type __a = __str.__alloc();
                     auto __allocation = std::__allocate_at_least(__a, __str.__get_long_cap());
                     __begin_lifetime(__allocation.ptr, __allocation.count);
-                    __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
+                    if (__is_long())
+                        __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
----------------
jyknight wrote:

Fixed via PR #67200.

https://github.com/llvm/llvm-project/pull/66576


More information about the cfe-commits mailing list