[cfe-commits] r69558 - /cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp

Chris Lattner sabre at nondot.org
Sun Apr 19 15:24:10 PDT 2009


Author: lattner
Date: Sun Apr 19 17:24:10 2009
New Revision: 69558

URL: http://llvm.org/viewvc/llvm-project?rev=69558&view=rev
Log:
don't crash on invalid ranges in -fprint-source-range-info
mode, just ignore them as usual.

Modified:
    cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp

Modified: cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp?rev=69558&r1=69557&r2=69558&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp (original)
+++ cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp Sun Apr 19 17:24:10 2009
@@ -267,6 +267,9 @@
         bool PrintedRange = false;
         
         for (unsigned i = 0, e = Info.getNumRanges(); i != e; ++i) {
+          // Ignore invalid ranges.
+          if (!Info.getRange(i).isValid()) continue;
+
           SourceLocation B = Info.getRange(i).getBegin();
           SourceLocation E = Info.getRange(i).getEnd();
           std::pair<FileID, unsigned> BInfo=SM.getDecomposedInstantiationLoc(B);





More information about the cfe-commits mailing list