Call llvm::remove_fatal_error_handler before deallocating objects
which are used by the error handling functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111427 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/driver/cc1as_main.cpp b/tools/driver/cc1as_main.cpp
index 077e118..4620b60 100644
--- a/tools/driver/cc1as_main.cpp
+++ b/tools/driver/cc1as_main.cpp
@@ -327,8 +327,8 @@
// Set an error handler, so that any LLVM backend diagnostics go through our
// error handler.
- install_fatal_error_handler(LLVMErrorHandler,
- static_cast<void*>(&Diags));
+ ScopedFatalErrorHandler FatalErrorHandler
+ (LLVMErrorHandler, static_cast<void*>(&Diags));
// Parse the arguments.
AssemblerInvocation Asm;