diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-06-16 00:44:07 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-06-16 00:44:07 +0000 |
commit | 52de271da1d56fe80e924bb57659de96e06246fd (patch) | |
tree | cadd4aba9804f90c801727f86f1eec1effb48ebb /llvm/lib/Support | |
parent | f5cad928f5de24f0a2b63b121aa242f7df72765d (diff) | |
download | bcm5719-llvm-52de271da1d56fe80e924bb57659de96e06246fd.tar.gz bcm5719-llvm-52de271da1d56fe80e924bb57659de96e06246fd.zip |
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. =/
llvm-svn: 158582
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r-- | llvm/lib/Support/Unix/Signals.inc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc index b2e5fd8b0a5..519511685dd 100644 --- a/llvm/lib/Support/Unix/Signals.inc +++ b/llvm/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 |