aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/BugReporter.cpp
diff options
context:
space:
mode:
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;
}