diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-04-19 22:24:10 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-04-19 22:24:10 +0000 |
| commit | 3251e3cfaa250e1d07f54dd51e515e738ebdf6c1 (patch) | |
| tree | 7e9c8486d47256dac38208d2c4ec26c78c43cdfb /clang/lib/Frontend | |
| parent | ddddff4f416b20ef16221414bb06cc9f465c82f3 (diff) | |
| download | bcm5719-llvm-3251e3cfaa250e1d07f54dd51e515e738ebdf6c1.tar.gz bcm5719-llvm-3251e3cfaa250e1d07f54dd51e515e738ebdf6c1.zip | |
don't crash on invalid ranges in -fprint-source-range-info
mode, just ignore them as usual.
llvm-svn: 69558
Diffstat (limited to 'clang/lib/Frontend')
| -rw-r--r-- | clang/lib/Frontend/TextDiagnosticPrinter.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/TextDiagnosticPrinter.cpp b/clang/lib/Frontend/TextDiagnosticPrinter.cpp index 7d3c4c23ffd..0dd71d7bb38 100644 --- a/clang/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/clang/lib/Frontend/TextDiagnosticPrinter.cpp @@ -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); |

