[all-commits] [llvm/llvm-project] 0687e4: [libc++] Remove UB in list, forward_list and __has...

Louis Dionne via All-commits all-commits at lists.llvm.org
Thu Oct 5 10:02:24 PDT 2023


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

  Changed paths:
    M libcxx/include/__hash_table
    M libcxx/include/__node_handle
    M libcxx/include/__tree
    M libcxx/include/ext/hash_map
    M libcxx/include/forward_list
    M libcxx/include/list
    M libcxx/include/unordered_map
    M libcxx/include/unordered_set

  Log Message:
  -----------
  [libc++] Remove UB in list, forward_list and __hash_table

This patch removes undefined behavior in list and forward_list and __hash_table
caused by improperly beginning and ending the lifetime of the various node
classes. It allows removing the _LIBCPP_STANDALONE_DEBUG macro from
these node types since we now properly begin and end their lifetime,
meaning that we won't trip up constructor homing.

See https://reviews.llvm.org/D98750 for more information on what prompted
this patch.

Differential Revision: https://reviews.llvm.org/D101206

Co-authored-by: Amy Kwan <amy.kwan1 at ibm.com>




More information about the All-commits mailing list