[llvm] Fix crash in install_bad_alloc_error_handler (PR #83160)

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 05:41:51 PST 2024


================
@@ -1132,4 +1132,26 @@ TEST(Error, moveInto) {
   }
 }
 
+TEST(Error, FatalBadAllocErrorHandlersInteraction) {
+  auto ErrorHandler = [](void *Data, const char *, bool) {};
+  install_fatal_error_handler(ErrorHandler, nullptr);
+  // The following call should not crash
----------------
aganea wrote:

I think you should expand just a little more your comment, just to explain we're doing this sequence of calls because of a bug that happened previously inside `install_bad_alloc_error_handler`.

https://github.com/llvm/llvm-project/pull/83160


More information about the llvm-commits mailing list