summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-02-16 03:41:01 +0000
committerAnna Zaks <ganna@apple.com>2012-02-16 03:41:01 +0000
commit95308d3798637bb4a3542520f71737b4b82d2262 (patch)
treed9d5d0364dcbab3991211f0808a2fefbfc50eea0 /clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
parentd32ead82d93f38ec11ba78a6c95bc41db377c99e (diff)
downloadbcm5719-llvm-95308d3798637bb4a3542520f71737b4b82d2262.tar.gz
bcm5719-llvm-95308d3798637bb4a3542520f71737b4b82d2262.zip
[analyzer] Diagnostics: Ensure that the default end of diagnostic path
piece can always be generated. The default end of diagnostic path piece was failing to generate on a BlockEdge that was outgoing from a basic block without a terminator, resulting in a very simple diagnostic being rendered (ex: no path highlighting or custom visitors). Reuse another function, which is essentially doing the same thing and correct it not to fail when a block has no terminator. llvm-svn: 150659
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
index 5ded6bcd568..bc03a2bc30e 100644
--- a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
+++ b/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
@@ -305,8 +305,9 @@ PathDiagnosticLocation
return PathDiagnosticLocation(PS->getStmt(), SM, LC);
else if (const BlockEdge *BE = dyn_cast<BlockEdge>(&P)) {
const Stmt *Term = BE->getSrc()->getTerminator();
- assert(Term);
- return PathDiagnosticLocation(Term, SM, LC);
+ if (Term) {
+ return PathDiagnosticLocation(Term, SM, LC);
+ }
}
NI = NI->succ_empty() ? 0 : *(NI->succ_begin());
}
OpenPOWER on IntegriCloud