diff options
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r-- | clang/lib/Frontend/DiagnosticRenderer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Frontend/DiagnosticRenderer.cpp b/clang/lib/Frontend/DiagnosticRenderer.cpp index 89d3867aadd..88a8706731c 100644 --- a/clang/lib/Frontend/DiagnosticRenderer.cpp +++ b/clang/lib/Frontend/DiagnosticRenderer.cpp @@ -363,6 +363,13 @@ static void mapDiagnosticRanges( End = SM->getImmediateExpansionRange(End).second; } BeginFileID = SM->getFileID(Begin); + if (BeginFileID != SM->getFileID(End)) { + // FIXME: Ugly hack to stop a crash; this code is making bad + // assumptions and it's too complicated for me to reason + // about. + Begin = End = SourceLocation(); + break; + } } // Return the spelling location of the beginning and end of the range. |