aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/Unix/Signals.inc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/Unix/Signals.inc')
-rw-r--r--lib/Support/Unix/Signals.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/Unix/Signals.inc b/lib/Support/Unix/Signals.inc
index b2e5fd8b0a..519511685d 100644
--- a/lib/Support/Unix/Signals.inc
+++ b/lib/Support/Unix/Signals.inc
@@ -189,7 +189,7 @@ void llvm::sys::SetInterruptFunction(void (*IF)()) {
bool llvm::sys::RemoveFileOnSignal(const sys::Path &Filename,
std::string* ErrMsg) {
SignalsMutex.acquire();
- std::string *OldPtr = &FilesToRemove[0];
+ std::string *OldPtr = FilesToRemove.empty() ? 0 : &FilesToRemove[0];
FilesToRemove.push_back(Filename.str());
// We want to call 'c_str()' on every std::string in this vector so that if