forked from OSchip/llvm-project
[analyzer] Avoid unneeded invalidation in RetainCountChecker
Differential Revision: https://reviews.llvm.org/D53168 llvm-svn: 344312
This commit is contained in:
parent
41dc8de6ae
commit
ca7a23e761
|
@ -802,25 +802,6 @@ bool RetainCountChecker::evalCall(const CallExpr *CE, CheckerContext &C) const {
|
|||
}
|
||||
state = state->BindExpr(CE, LCtx, RetVal, false);
|
||||
|
||||
// FIXME: This should not be necessary, but otherwise the argument seems to be
|
||||
// considered alive during the next statement.
|
||||
if (const MemRegion *ArgRegion = RetVal.getAsRegion()) {
|
||||
// Save the refcount status of the argument.
|
||||
SymbolRef Sym = RetVal.getAsLocSymbol();
|
||||
const RefVal *Binding = nullptr;
|
||||
if (Sym)
|
||||
Binding = getRefBinding(state, Sym);
|
||||
|
||||
// Invalidate the argument region.
|
||||
state = state->invalidateRegions(
|
||||
ArgRegion, CE, C.blockCount(), LCtx,
|
||||
/*CausesPointerEscape*/ hasTrustedImplementationAnnotation);
|
||||
|
||||
// Restore the refcount status of the argument.
|
||||
if (Binding)
|
||||
state = setRefBinding(state, Sym, *Binding);
|
||||
}
|
||||
|
||||
C.addTransition(state);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue