don't crash on invalid ranges in -fprint-source-range-info

mode, just ignore them as usual.

llvm-svn: 69558
This commit is contained in:
Chris Lattner 2009-04-19 22:24:10 +00:00
parent ddddff4f41
commit 3251e3cfaa
1 changed files with 3 additions and 0 deletions

View File

@ -267,6 +267,9 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level,
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);