diff options
author | Josh Stone <jistone@redhat.com> | 2025-01-27 09:04:43 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-27 09:04:43 -0800 |
commit | b80965efc1ea3f30cbdac090d869b1000fca5d2b (patch) | |
tree | de270b67b1c31d2e56968ae56d8eec174c0eb2c1 /libcxx/src/algorithm.cpp | |
parent | 08c364280a790cb2a80fff86beb5ea69782ce667 (diff) | |
download | llvm-b80965efc1ea3f30cbdac090d869b1000fca5d2b.zip llvm-b80965efc1ea3f30cbdac090d869b1000fca5d2b.tar.gz llvm-b80965efc1ea3f30cbdac090d869b1000fca5d2b.tar.bz2 |
[Support] Report OOM from `allocate_buffer` (#85449)
Previously, it called `::operator new` which may throw `std::bad_alloc`,
regardless of whether LLVM itself was built with exception handling, and
this can cause safety issues if outside code has destructors that will
call back into LLVM. Now we use `::operator new(..., nothrow)` and call
`llvm::report_bad_alloc_error` when allocation fails, which will abort
when LLVM is built without exceptions.
Ref: https://github.com/llvm/llvm-project/issues/85281
Diffstat (limited to 'libcxx/src/algorithm.cpp')
0 files changed, 0 insertions, 0 deletions