[libcxx-commits] [libcxx] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Sep 18 06:43:19 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());
----------------
philnik777 wrote:
That looks like a pretty serious bug to me. Could you move this change into it's own PR with the test-case added?
https://github.com/llvm/llvm-project/pull/66576
More information about the libcxx-commits
mailing list