summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-04-30 05:51:50 +0000
committerTed Kremenek <kremenek@apple.com>2009-04-30 05:51:50 +0000
commitb4e27a18383b8fb041ab432a83e7e41f05f9cef1 (patch)
tree808f7f76377831b63cfa0b001101a0b2b4d2d1fd /clang/lib/Analysis/CFRefCount.cpp
parent497df9126f0b89d0b1b85c334d4fba244b504882 (diff)
downloadbcm5719-llvm-b4e27a18383b8fb041ab432a83e7e41f05f9cef1.tar.gz
bcm5719-llvm-b4e27a18383b8fb041ab432a83e7e41f05f9cef1.zip
Handle case in EvalReturn where we cache out in the ExplodedGraph.
llvm-svn: 70475
Diffstat (limited to 'clang/lib/Analysis/CFRefCount.cpp')
-rw-r--r--clang/lib/Analysis/CFRefCount.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp
index 1dc52c797c8..eb7d04a3425 100644
--- a/clang/lib/Analysis/CFRefCount.cpp
+++ b/clang/lib/Analysis/CFRefCount.cpp
@@ -3008,6 +3008,10 @@ void CFRefCount::EvalReturn(ExplodedNodeSet<GRState>& Dst,
state = state.set<RefBindings>(Sym, X);
Pred = Builder.MakeNode(Dst, S, Pred, state);
+ // Did we cache out?
+ if (!Pred)
+ return;
+
// Any leaks or other errors?
if (X.isReturnedOwned() && X.getCount() == 0) {
const Decl *CD = &Eng.getStateManager().getCodeDecl();
@@ -3018,13 +3022,13 @@ void CFRefCount::EvalReturn(ExplodedNodeSet<GRState>& Dst,
static int ReturnOwnLeakTag = 0;
state = state.set<RefBindings>(Sym, X ^ RefVal::ErrorLeakReturned);
// Generate an error node.
- ExplodedNode<GRState> *N =
- Builder.generateNode(PostStmt(S, &ReturnOwnLeakTag), state, Pred);
-
- CFRefLeakReport *report =
- new CFRefLeakReport(*static_cast<CFRefBug*>(leakAtReturn), *this,
- N, Sym, Eng);
- BR->EmitReport(report);
+ if (ExplodedNode<GRState> *N =
+ Builder.generateNode(PostStmt(S, &ReturnOwnLeakTag), state, Pred)) {
+ CFRefLeakReport *report =
+ new CFRefLeakReport(*static_cast<CFRefBug*>(leakAtReturn), *this,
+ N, Sym, Eng);
+ BR->EmitReport(report);
+ }
}
}
}
OpenPOWER on IntegriCloud