fix 7320: we can't delete a trailing space if it doesn't exist.

llvm-svn: 113125
This commit is contained in:
Chris Lattner 2010-09-05 23:16:09 +00:00
parent 8ed2bac65d
commit f0b0497343
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}
}