summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/BugReporter.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-05-04 18:15:17 +0000
committerTed Kremenek <kremenek@apple.com>2009-05-04 18:15:17 +0000
commite396f72ec70866ca38015ea65f4ddc454958545d (patch)
treebead4081b31c739a0c8d04e511a8634746af546b /clang/lib/Analysis/BugReporter.cpp
parent357e03cedeee3ad5e45791fbe92b2ff148428e42 (diff)
downloadbcm5719-llvm-e396f72ec70866ca38015ea65f4ddc454958545d.tar.gz
bcm5719-llvm-e396f72ec70866ca38015ea65f4ddc454958545d.zip
BugReporter (extensive diagnostics): don't mark location contexts that are
control-flow expressions as dead. llvm-svn: 70887
Diffstat (limited to 'clang/lib/Analysis/BugReporter.cpp')
-rw-r--r--clang/lib/Analysis/BugReporter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Analysis/BugReporter.cpp b/clang/lib/Analysis/BugReporter.cpp
index dcc88febec9..a9d67713098 100644
--- a/clang/lib/Analysis/BugReporter.cpp
+++ b/clang/lib/Analysis/BugReporter.cpp
@@ -955,7 +955,8 @@ void EdgeBuilder::addEdge(PathDiagnosticLocation NewLoc, bool alwaysAdd) {
// Is the top location context the same as the one for the new location?
if (TopContextLoc == CLoc) {
if (alwaysAdd) {
- if (IsConsumedExpr(TopContextLoc))
+ if (IsConsumedExpr(TopContextLoc) &&
+ !IsControlFlowExpr(TopContextLoc.asStmt()))
TopContextLoc.markDead();
rawAddEdge(NewLoc);
@@ -968,7 +969,7 @@ void EdgeBuilder::addEdge(PathDiagnosticLocation NewLoc, bool alwaysAdd) {
if (alwaysAdd) {
rawAddEdge(NewLoc);
- if (IsConsumedExpr(CLoc)) {
+ if (IsConsumedExpr(CLoc) && !IsControlFlowExpr(CLoc.asStmt())) {
CLocs.push_back(ContextLocation(CLoc, true));
return;
}
OpenPOWER on IntegriCloud