From 7e76944c269ee1da38d07cfa7f16c2f8e8321a40 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Thu, 3 Apr 2008 07:13:10 +0000 Subject: [PATCH] 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 --- Driver/HTMLDiagnostics.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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\n"; R.InsertStrBefore(SourceLocation::getFileLoc(FileID, 0), os.str()); } -- 2.40.0