aboutsummaryrefslogtreecommitdiff
path: root/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
commit4c6f8d38e2795c67048e16e737b8225eeb184262 (patch)
tree5122d544e4fa1448063eed8d1d4e04def510102e /lib/Analysis/BugReporter.cpp
parent65d80fd4acfe65400b7ad594042adc08e972c405 (diff)
BugReporter (extensive diagnostics): don't mark location contexts that are
control-flow expressions as dead. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70887 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BugReporter.cpp')
-rw-r--r--lib/Analysis/BugReporter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp
index dcc88febec..a9d6771309 100644
--- a/lib/Analysis/BugReporter.cpp
+++ b/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;
}