aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-09-05 23:16:09 +0000
committerChris Lattner <sabre@nondot.org>2010-09-05 23:16:09 +0000
commit96de25986d28171945db96a6c6a54f91fd12ae4b (patch)
tree8a996c284ee2888018709779a184219ade95961f
parent957c094bd435c9ae367a9fcf375a5fadcc0c2bff (diff)
fix 7320: we can't delete a trailing space if it doesn't exist.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113125 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Lex/Pragma.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp
index 7975da58b6..a7b289e137 100644
--- a/lib/Lex/Pragma.cpp
+++ b/lib/Lex/Pragma.cpp
@@ -384,7 +384,9 @@ void Preprocessor::HandlePragmaDependency(Token &DependencyTok) {
Lex(DependencyTok);
}
- Message.erase(Message.end()-1);
+ // Remove the trailing ' ' if present.
+ if (!Message.empty())
+ Message.erase(Message.end()-1);
Diag(FilenameTok, diag::pp_out_of_date_dependency) << Message;
}
}