|
@@ -2182,9 +2182,8 @@ PathDiagnosticPiece *CFRefReportVisitor::VisitNode(const ExplodedNode *N,
|
|
|
|
|
|
// Add the range by scanning the children of the statement for any bindings
|
|
// Add the range by scanning the children of the statement for any bindings
|
|
// to Sym.
|
|
// to Sym.
|
|
- for (Stmt::const_child_iterator I = S->child_begin(), E = S->child_end();
|
|
|
|
- I!=E; ++I)
|
|
|
|
- if (const Expr *Exp = dyn_cast_or_null<Expr>(*I))
|
|
|
|
|
|
+ for (const Stmt *Child : S->children())
|
|
|
|
+ if (const Expr *Exp = dyn_cast_or_null<Expr>(Child))
|
|
if (CurrSt->getSValAsScalarOrLoc(Exp, LCtx).getAsLocSymbol() == Sym) {
|
|
if (CurrSt->getSValAsScalarOrLoc(Exp, LCtx).getAsLocSymbol() == Sym) {
|
|
P->addRange(Exp->getSourceRange());
|
|
P->addRange(Exp->getSourceRange());
|
|
break;
|
|
break;
|
|
@@ -2779,16 +2778,14 @@ void RetainCountChecker::processObjCLiterals(CheckerContext &C,
|
|
const Expr *Ex) const {
|
|
const Expr *Ex) const {
|
|
ProgramStateRef state = C.getState();
|
|
ProgramStateRef state = C.getState();
|
|
const ExplodedNode *pred = C.getPredecessor();
|
|
const ExplodedNode *pred = C.getPredecessor();
|
|
- for (Stmt::const_child_iterator it = Ex->child_begin(), et = Ex->child_end() ;
|
|
|
|
- it != et ; ++it) {
|
|
|
|
- const Stmt *child = *it;
|
|
|
|
- SVal V = state->getSVal(child, pred->getLocationContext());
|
|
|
|
|
|
+ for (const Stmt *Child : Ex->children()) {
|
|
|
|
+ SVal V = state->getSVal(Child, pred->getLocationContext());
|
|
if (SymbolRef sym = V.getAsSymbol())
|
|
if (SymbolRef sym = V.getAsSymbol())
|
|
if (const RefVal* T = getRefBinding(state, sym)) {
|
|
if (const RefVal* T = getRefBinding(state, sym)) {
|
|
RefVal::Kind hasErr = (RefVal::Kind) 0;
|
|
RefVal::Kind hasErr = (RefVal::Kind) 0;
|
|
state = updateSymbol(state, sym, *T, MayEscape, hasErr, C);
|
|
state = updateSymbol(state, sym, *T, MayEscape, hasErr, C);
|
|
if (hasErr) {
|
|
if (hasErr) {
|
|
- processNonLeakError(state, child->getSourceRange(), hasErr, sym, C);
|
|
|
|
|
|
+ processNonLeakError(state, Child->getSourceRange(), hasErr, sym, C);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|