summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/NSErrorChecker.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-11-11 03:26:34 +0000
committerTed Kremenek <kremenek@apple.com>2009-11-11 03:26:34 +0000
commit5e1f78aeb1ef11a2d1d9d58d8e6c2dd556310f8d (patch)
treeb899c9170fd593190b9fee4335daec7e58e80b15 /clang/lib/Analysis/NSErrorChecker.cpp
parent598825e8323aa48799bb9dbb4b234e86441fe921 (diff)
downloadbcm5719-llvm-5e1f78aeb1ef11a2d1d9d58d8e6c2dd556310f8d.tar.gz
bcm5719-llvm-5e1f78aeb1ef11a2d1d9d58d8e6c2dd556310f8d.zip
Refactor DereferenceChecker to use only the new Checker API instead of
the old builder API. This percolated a bunch of changes up to the Checker class (where CheckLocation has been renamed VisitLocation) and GRExprEngine. ProgramPoint now has the notion of a "LocationCheck" point (with PreLoad and PreStore respectively), and a bunch of the old ProgramPoints that are no longer used have been removed. llvm-svn: 86798
Diffstat (limited to 'clang/lib/Analysis/NSErrorChecker.cpp')
-rw-r--r--clang/lib/Analysis/NSErrorChecker.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/Analysis/NSErrorChecker.cpp b/clang/lib/Analysis/NSErrorChecker.cpp
index 307686ff57b..93b617b115d 100644
--- a/clang/lib/Analysis/NSErrorChecker.cpp
+++ b/clang/lib/Analysis/NSErrorChecker.cpp
@@ -209,15 +209,12 @@ void NSErrorChecker::CheckParamDeref(const VarDecl *Param,
return;
// Iterate over the implicit-null dereferences.
- NullDerefChecker *Checker = Eng.getChecker<NullDerefChecker>();
- assert(Checker && "NullDerefChecker not exist.");
- for (NullDerefChecker::iterator I = Checker->implicit_nodes_begin(),
- E = Checker->implicit_nodes_end(); I != E; ++I) {
-
+ ExplodedNode *const* I, *const* E;
+ llvm::tie(I, E) = GetImplicitNullDereferences(Eng);
+ for ( ; I != E; ++I) {
const GRState *state = (*I)->getState();
- const SVal* X = state->get<GRState::NullDerefTag>();
-
- if (!X || X->getAsSymbol() != ParamSym)
+ SVal location = state->getSVal((*I)->getLocationAs<StmtPoint>()->getStmt());
+ if (location.getAsSymbol() != ParamSym)
continue;
// Emit an error.
OpenPOWER on IntegriCloud