aboutsummaryrefslogtreecommitdiff
path: root/Driver/HTMLDiagnostics.cpp
diff options
context:
space:
mode:
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());
}