summaryrefslogtreecommitdiff
path: root/Common/ErrorHandler.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-01-19 10:05:49 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-01-19 10:05:49 +0000
commite2fd426bdafe9f5c10066d3926ece6e342184a67 (patch)
treebfbbb5fd38554e6b8988b7a217e9fd0623728d7d /Common/ErrorHandler.cpp
parent84c4061b34e048f47e5eb4fbabc1558495e8157c (diff)
Notes
Diffstat (limited to 'Common/ErrorHandler.cpp')
-rw-r--r--Common/ErrorHandler.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Common/ErrorHandler.cpp b/Common/ErrorHandler.cpp
index d1cb3dbbe03c..c059516daf94 100644
--- a/Common/ErrorHandler.cpp
+++ b/Common/ErrorHandler.cpp
@@ -47,8 +47,9 @@ ErrorHandler &lld::errorHandler() {
}
void lld::exitLld(int Val) {
- // Delete the output buffer so that any tempory file is deleted.
- errorHandler().OutputBuffer.reset();
+ // Delete any temporary file, while keeping the memory mapping open.
+ if (errorHandler().OutputBuffer)
+ errorHandler().OutputBuffer->discard();
// Dealloc/destroy ManagedStatic variables before calling
// _exit(). In a non-LTO build, this is a nop. In an LTO