[cfe-commits] r111427 - in /cfe/trunk/tools/driver: cc1_main.cpp cc1as_main.cpp
Dan Gohman
gohman at apple.com
Wed Aug 18 14:23:18 PDT 2010
Author: djg
Date: Wed Aug 18 16:23:17 2010
New Revision: 111427
URL: http://llvm.org/viewvc/llvm-project?rev=111427&view=rev
Log:
Call llvm::remove_fatal_error_handler before deallocating objects
which are used by the error handling functions.
Modified:
cfe/trunk/tools/driver/cc1_main.cpp
cfe/trunk/tools/driver/cc1as_main.cpp
Modified: cfe/trunk/tools/driver/cc1_main.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1_main.cpp?rev=111427&r1=111426&r2=111427&view=diff
==============================================================================
--- cfe/trunk/tools/driver/cc1_main.cpp (original)
+++ cfe/trunk/tools/driver/cc1_main.cpp Wed Aug 18 16:23:17 2010
@@ -163,6 +163,11 @@
// results now. This happens in -disable-free mode.
llvm::TimerGroup::printAll(llvm::errs());
+ // Our error handler depends on the Diagnostics object, which we're
+ // potentially about to delete. Uninstall the handler now so that any
+ // later errors use the default handling behavior instead.
+ llvm::remove_fatal_error_handler();
+
// When running with -disable-free, don't do any destruction or shutdown.
if (Clang->getFrontendOpts().DisableFree) {
if (Clang->getFrontendOpts().ShowStats)
Modified: cfe/trunk/tools/driver/cc1as_main.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1as_main.cpp?rev=111427&r1=111426&r2=111427&view=diff
==============================================================================
--- cfe/trunk/tools/driver/cc1as_main.cpp (original)
+++ cfe/trunk/tools/driver/cc1as_main.cpp Wed Aug 18 16:23:17 2010
@@ -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;
More information about the cfe-commits
mailing list