[all-commits] [llvm/llvm-project] 848b20: [libc++] Correctly handle custom deleters in harde...

Louis Dionne via All-commits all-commits at lists.llvm.org
Thu Oct 3 08:46:19 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 848b20de76def980d02bb17bcb0bdc95381876df
      https://github.com/llvm/llvm-project/commit/848b20de76def980d02bb17bcb0bdc95381876df
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2024-10-03 (Thu, 03 Oct 2024)

  Changed paths:
    M libcxx/include/__memory/array_cookie.h
    M libcxx/include/__memory/unique_ptr.h
    M libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/assert.subscript.pass.cpp
    M libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_subscript.runtime.pass.cpp

  Log Message:
  -----------
  [libc++] Correctly handle custom deleters in hardened unique_ptr<T[]> (#110685)

It turns out that we can never do bounds-checking for unique_ptrs with
custom deleters, except when converting from a unique_ptr with a default
deleter to one with a custom deleter.

If we had an API like `std::make_unique` that allowed passing a custom
deleter, we could at least get bounds checking when the unique_ptr is
created through those APIs, but for now that is not possible.

Fixes #110683



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list