[all-commits] [llvm/llvm-project] 0f9ab7: [libc++][hardening] Add hardening assertions to st...

David Benjamin via All-commits all-commits at lists.llvm.org
Tue Jan 30 06:23:26 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0f9ab7b861268618988c5271e2227b9ab4c1827b
      https://github.com/llvm/llvm-project/commit/0f9ab7b861268618988c5271e2227b9ab4c1827b
  Author: David Benjamin <davidben at google.com>
  Date:   2024-01-30 (Tue, 30 Jan 2024)

  Changed paths:
    M libcxx/include/deque
    M libcxx/test/libcxx/containers/sequences/deque/asan_caterpillar.pass.cpp
    A libcxx/test/libcxx/containers/sequences/deque/assert.pass.cpp

  Log Message:
  -----------
  [libc++][hardening] Add hardening assertions to std::deque (#79397)

This aligns std::deque with std::vector w.r.t. hardening checks. There's
probably more that can be done with iterators, but start with this.

This caught a bug with one of libc++'s tests. One of the erase calls in
asan_caterpillar.pass.cpp was a no-op because the iterators were in the
other order. (deque::erase happened to cleanly do nothing when the
distance is negative.)

Fixes #63809




More information about the All-commits mailing list