Added guard for printing out PathDiagnostics whose last element ends with

a piece with a SourceLocation that does not have a FileID.

llvm-svn: 49151
This commit is contained in:
Ted Kremenek 2008-04-03 07:13:10 +00:00
parent c599179267
commit b73d6dda84
1 changed files with 5 additions and 1 deletions

View File

@ -74,6 +74,9 @@ void HTMLDiagnostics::HandlePathDiagnostic(const PathDiagnostic& D) {
if (D.empty())
return;
if (!D.back()->getLocation().isFileID())
return;
// Create the HTML directory if it is missing.
if (!createdDir) {
@ -151,7 +154,8 @@ void HTMLDiagnostics::HandlePathDiagnostic(const PathDiagnostic& D) {
{
std::ostringstream os;
os << "\n<!-- BUGLINE " << D.back()->getLocation().getLineNumber()
FullSourceLoc L = D.back()->getLocation();
os << "\n<!-- BUGLINE " << L.getLineNumber()
<< " -->\n";
R.InsertStrBefore(SourceLocation::getFileLoc(FileID, 0), os.str());
}