summaryrefslogtreecommitdiff
path: root/lib/Support
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-06-16 00:44:07 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-06-16 00:44:07 +0000
commit29436629dad875cd99cd31cc2f8499f3623effb3 (patch)
treee37c516efb81d511a3ff716d5a2eeb2289a9413f /lib/Support
parent0b8b3ba21ee7c1a16ac844965dbace820b263bc0 (diff)
downloadllvm-29436629dad875cd99cd31cc2f8499f3623effb3.tar.gz
llvm-29436629dad875cd99cd31cc2f8499f3623effb3.tar.bz2
llvm-29436629dad875cd99cd31cc2f8499f3623effb3.tar.xz
Don't call 'FilesToRemove[0]' when the vector is empty, even to compute
the address of it. Found by a checking STL implementation used on a dragonegg builder. Sorry about this one. =/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158582 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-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