Fix up uses of new/terminate/unexpected handlers to use the new getters.
llvm-svn: 120914
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 816cb8975d91d436da0dd56b8316c69080cb51b3
diff --git a/src/exception.cpp b/src/exception.cpp
index 062114c..6c389c2 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -38,7 +38,7 @@
void
std::unexpected()
{
- (*__unexpected_handler)();
+ (*get_unexpected())();
// unexpected handler should not return
std::terminate();
}
@@ -62,7 +62,7 @@
try
{
#endif // _LIBCPP_NO_EXCEPTIONS
- (*__terminate_handler)();
+ (*get_terminate())();
// handler should not return
::abort ();
#ifndef _LIBCPP_NO_EXCEPTIONS
diff --git a/src/new.cpp b/src/new.cpp
index a3783d4..e0bb734 100644
--- a/src/new.cpp
+++ b/src/new.cpp
@@ -36,8 +36,9 @@
{
// If malloc fails and there is a new_handler,
// call it to try free up memory.
- if (__new_handler)
- __new_handler();
+ std::new_handler nh = get_new_handler();
+ if (nh)
+ nh();
else
#ifndef _LIBCPP_NO_EXCEPTIONS
throw std::bad_alloc();