[all-commits] [llvm/llvm-project] f722db: [libc++] Use correct size for deallocation of arra...
Ilya Biryukov via All-commits
all-commits at lists.llvm.org
Thu Oct 5 06:28:11 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: f722db02d359e29ca001b78197ee1a275f8c3d7c
https://github.com/llvm/llvm-project/commit/f722db02d359e29ca001b78197ee1a275f8c3d7c
Author: Ilya Biryukov <ibiryukov at google.com>
Date: 2023-10-05 (Thu, 05 Oct 2023)
Changed paths:
M libcxx/include/__memory/shared_ptr.h
A libcxx/test/libcxx/memory/shared_ptr_array.pass.cpp
Log Message:
-----------
[libc++] Use correct size for deallocation of arrays in shared_ptr (#68233)
Fixes #68051.
Current implementation passes the number of `_AlignedStorage` objects
when it calls to `allocate` and the number of **bytes** on `deallocate`.
This only applies to allocations that allocate control block and the
storage together, i.e. `make_shared` and `allocate_shared`.
Found by ASan under Clang combined with `-fsized-deallocation`.
More information about the All-commits
mailing list