[analyzer] Avoid unneeded invalidation in RetainCountChecker

Differential Revision: https://reviews.llvm.org/D53168

llvm-svn: 344312
This commit is contained in:
George Karpenkov 2018-10-11 22:59:38 +00:00
parent 41dc8de6ae
commit ca7a23e761
1 changed files with 0 additions and 19 deletions

View File

@ -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;
}