[all-commits] [llvm/llvm-project] b2ddd3: [CIR] Fix DeleteArrayOp lowering for unsized delet...

adams381 via All-commits all-commits at lists.llvm.org
Wed Apr 29 13:08:13 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b2ddd3c0d973f16cc08ccebf21cb4de9f8f43af3
      https://github.com/llvm/llvm-project/commit/b2ddd3c0d973f16cc08ccebf21cb4de9f8f43af3
  Author: adams381 <adams at nvidia.com>
  Date:   2026-04-29 (Wed, 29 Apr 2026)

  Changed paths:
    M clang/lib/CIR/Dialect/Transforms/CXXABILowering.cpp
    A clang/test/CIR/CodeGen/delete-array-unsized-dtor.cpp

  Log Message:
  -----------
  [CIR] Fix DeleteArrayOp lowering for unsized delete with destructor (#194711)

`CIRDeleteArrayOpABILowering` asserts that `deleteParams.getSize()` must
be true when `elementDtorAttr` is set. This is wrong — a cookie is
needed for the destructor loop regardless of whether `operator delete[]`
takes a size parameter. With `-fno-sized-deallocation` (or C++14
defaults on some targets), you get unsized `::operator delete[](void*)`
with a non-trivial destructor, which hits the assertion.

Fix: set `cookieRequired` when either `getSize()` or
`getElementDtorAttr()` is true, and only compute/pass the allocation
size when `getSize()` is true.

Found while building the Eigen test suite with CIR.



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