forked from OSchip/llvm-project
Handle case in EvalReturn where we cache out in the ExplodedGraph.
llvm-svn: 70475
This commit is contained in:
parent
497df9126f
commit
b4e27a1838
|
@ -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,9 +3022,8 @@ 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);
|
||||
|
||||
if (ExplodedNode<GRState> *N =
|
||||
Builder.generateNode(PostStmt(S, &ReturnOwnLeakTag), state, Pred)) {
|
||||
CFRefLeakReport *report =
|
||||
new CFRefLeakReport(*static_cast<CFRefBug*>(leakAtReturn), *this,
|
||||
N, Sym, Eng);
|
||||
|
@ -3028,6 +3031,7 @@ void CFRefCount::EvalReturn(ExplodedNodeSet<GRState>& Dst,
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Assumptions.
|
||||
|
|
Loading…
Reference in New Issue