aboutsummaryrefslogtreecommitdiff
path: root/Driver/HTMLDiagnostics.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-03 07:13:10 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-03 07:13:10 +0000
commit7e76944c269ee1da38d07cfa7f16c2f8e8321a40 (patch)
treed61bd714dc44abb290b90d5f52414ec4b35371c1 /Driver/HTMLDiagnostics.cpp
parent49cd6354d5373245dd2e69ca7b7113e6a795d36e (diff)
Added guard for printing out PathDiagnostics whose last element ends with
a piece with a SourceLocation that does not have a FileID. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49151 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/HTMLDiagnostics.cpp')
-rw-r--r--Driver/HTMLDiagnostics.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Driver/HTMLDiagnostics.cpp b/Driver/HTMLDiagnostics.cpp
index 69e77bc2fe..c29096d0f6 100644
--- a/Driver/HTMLDiagnostics.cpp
+++ b/Driver/HTMLDiagnostics.cpp
@@ -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());
}