aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/BugReporter.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-03 18:00:37 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-03 18:00:37 +0000
commitde7161fa687201393edf0b92a0bc9c6d4023cc84 (patch)
tree7a2c498b3f975019fe89c24fd24324b24a40fd6d /lib/Analysis/BugReporter.cpp
parentf1ae705460552655fe7275327804444c62e86bae (diff)
Use "getRanges" in default implementation of "getEndPath" to determine
the ranges of highlighted elements in the source code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49181 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BugReporter.cpp')
-rw-r--r--lib/Analysis/BugReporter.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp
index 9954298165..8eb200017f 100644
--- a/lib/Analysis/BugReporter.cpp
+++ b/lib/Analysis/BugReporter.cpp
@@ -53,8 +53,18 @@ BugDescription::getEndPath(ASTContext& Ctx, ExplodedNode<ValueState> *N) const {
FullSourceLoc L(S->getLocStart(), Ctx.getSourceManager());
PathDiagnosticPiece* P = new PathDiagnosticPiece(L, getDescription());
- if (Expr* E = dyn_cast<Expr>(S))
- P->addRange(E->getSourceRange());
+ const SourceRange *Beg, *End;
+ getRanges(Beg, End);
+
+ if (Beg == End) {
+ if (Expr* E = dyn_cast<Expr>(S))
+ P->addRange(E->getSourceRange());
+ }
+ else {
+ assert (Beg < End);
+ for (; Beg != End; ++Beg)
+ P->addRange(*Beg);
+ }
return P;
}