diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-05-11 23:50:59 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-05-11 23:50:59 +0000 |
commit | 3ef538dd1bb1001fa1a1d50594d13f480a8dfa21 (patch) | |
tree | 9ea47c4145ff2d9b9b78316780195cf4a10a660d /lib/Analysis/BugReporter.cpp | |
parent | b9de2c55b2a33776e2bee8ee57df7599b374c8a5 (diff) |
BugReport::getEndPath() - Only add a Stmt's range to the constructed PathDiagnosticEventPiece if the BugReport contained no explicit ranges.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BugReporter.cpp')
-rw-r--r-- | lib/Analysis/BugReporter.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp index 23f3342399..4726eacb32 100644 --- a/lib/Analysis/BugReporter.cpp +++ b/lib/Analysis/BugReporter.cpp @@ -1198,13 +1198,16 @@ BugReport::getEndPath(BugReporterContext& BRC, if (!S) return NULL; - - FullSourceLoc L(S->getLocStart(), BRC.getSourceManager()); - PathDiagnosticPiece* P = new PathDiagnosticEventPiece(L, getDescription()); - + const SourceRange *Beg, *End; - getRanges(BRC.getBugReporter(), Beg, End); + getRanges(BRC.getBugReporter(), Beg, End); + PathDiagnosticLocation L(S, BRC.getSourceManager()); + // Only add the statement itself as a range if we didn't specify any + // special ranges for this report. + PathDiagnosticPiece* P = new PathDiagnosticEventPiece(L, getDescription(), + Beg == End); + for (; Beg != End; ++Beg) P->addRange(*Beg); |