[libcxx-commits] [libcxx] 2583946 - [libc++] Use _LIBCPP_VERBOSE_ABORT from __throw_bad_alloc

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 10 05:32:15 PDT 2023


Author: Louis Dionne
Date: 2023-08-10T08:32:01-04:00
New Revision: 2583946e1fdfba432a3e00714aaa7468f7b0f061

URL: https://github.com/llvm/llvm-project/commit/2583946e1fdfba432a3e00714aaa7468f7b0f061
DIFF: https://github.com/llvm/llvm-project/commit/2583946e1fdfba432a3e00714aaa7468f7b0f061.diff

LOG: [libc++] Use _LIBCPP_VERBOSE_ABORT from __throw_bad_alloc

It seems like this one was forgotten and we were still using a raw
std::abort().

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

Added: 
    

Modified: 
    libcxx/src/new_helpers.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/src/new_helpers.cpp b/libcxx/src/new_helpers.cpp
index 45a0a661db0e41..6560d0188ee32b 100644
--- a/libcxx/src/new_helpers.cpp
+++ b/libcxx/src/new_helpers.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <cstdlib>
+#include <__verbose_abort>
 #include <new>
 
 namespace std { // purposefully not versioned
@@ -21,7 +21,7 @@ void __throw_bad_alloc() {
 #  ifndef _LIBCPP_HAS_NO_EXCEPTIONS
   throw bad_alloc();
 #  else
-  std::abort();
+  _LIBCPP_VERBOSE_ABORT("bad_alloc was thrown in -fno-exceptions mode");
 #  endif
 }
 


        


More information about the libcxx-commits mailing list