[analyzer] Support post-visiting ObjCIvarRefExprs for checkers.
llvm-svn: 123263
diff --git a/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
index 3f9eb1b..f19f806 100644
--- a/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
@@ -2070,6 +2070,8 @@
const Expr *baseExpr = Ex->getBase();
Visit(baseExpr, Pred, dstBase);
+ ExplodedNodeSet dstIvar;
+
// Using the base, compute the lvalue of the instance variable.
for (ExplodedNodeSet::iterator I = dstBase.begin(), E = dstBase.end();
I!=E; ++I) {
@@ -2077,8 +2079,12 @@
const GRState *state = GetState(nodeBase);
SVal baseVal = state->getSVal(baseExpr);
SVal location = state->getLValue(Ex->getDecl(), baseVal);
- MakeNode(Dst, Ex, *I, state->BindExpr(Ex, location));
+ MakeNode(dstIvar, Ex, *I, state->BindExpr(Ex, location));
}
+
+ // Perform the post-condition check of the ObjCIvarRefExpr and store
+ // the created nodes in 'Dst'.
+ CheckerVisit(Ex, Dst, dstIvar, PostVisitStmtCallback);
}
//===----------------------------------------------------------------------===//