aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CommandFlags.cpp
diff options
context:
space:
mode:
authorvarconst <varconsteq@gmail.com>2023-07-12 10:11:09 -0700
committervarconst <varconsteq@gmail.com>2023-07-12 10:11:26 -0700
commitd0b51657c259365750b3aada3bae23f19c96fdbc (patch)
treea4cf8f31b1b04a1983156b3591a4d15eb7e299d7 /llvm/lib/CodeGen/CommandFlags.cpp
parent345f8699c7ce8e492899147a7f0519769af7ec35 (diff)
downloadllvm-d0b51657c259365750b3aada3bae23f19c96fdbc.zip
llvm-d0b51657c259365750b3aada3bae23f19c96fdbc.tar.gz
llvm-d0b51657c259365750b3aada3bae23f19c96fdbc.tar.bz2
[libc++] Fix an exception safety issue in `forward_list` and add tests.
When inserting nodes into a forward list, each new node is allocated but not constructed. The constructor was being called explicitly on the node `value_` but the `next_` pointer remained uninitialized rather than being set to null. This bug is only triggered in the cleanup code if an exception is thrown -- upon successful creation of new nodes, the last incorrect "next" value is overwritten to a correct pointer. This issue was found due to new tests added in https://reviews.llvm.org/D149830. Differential Revision: https://reviews.llvm.org/D152327
Diffstat (limited to 'llvm/lib/CodeGen/CommandFlags.cpp')
0 files changed, 0 insertions, 0 deletions