[cfe-commits] r149319 - /cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp

Ted Kremenek kremenek at apple.com
Mon Jan 30 17:19:58 PST 2012


Author: kremenek
Date: Mon Jan 30 19:19:57 2012
New Revision: 149319

URL: http://llvm.org/viewvc/llvm-project?rev=149319&view=rev
Log:
Convert checker over to using ProgramStateRef.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp?rev=149319&r1=149318&r2=149319&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp Mon Jan 30 19:19:57 2012
@@ -79,7 +79,7 @@
 
 void ObjCContainersChecker::addSizeInfo(const Expr *Array, const Expr *Size,
                                         CheckerContext &C) const {
-  const ProgramState *State = C.getState();
+  ProgramStateRef State = C.getState();
   SVal SizeV = State->getSVal(Size, C.getLocationContext());
   // Undefined is reported by another checker.
   if (SizeV.isUnknownOrUndef())
@@ -124,7 +124,7 @@
 
   // Check the array access.
   if (Name.equals("CFArrayGetValueAtIndex")) {
-    const ProgramState *State = C.getState();
+    ProgramStateRef State = C.getState();
     // Retrieve the size.
     // Find out if we saw this array symbol before and have information about it.
     const Expr *ArrayExpr = CE->getArg(0);
@@ -140,8 +140,8 @@
     
     // Now, check if 'Idx in [0, Size-1]'.
     const QualType T = IdxExpr->getType();
-    const ProgramState *StInBound = State->assumeInBound(Idx, Size, true, T);
-    const ProgramState *StOutBound = State->assumeInBound(Idx, Size, false, T);
+    ProgramStateRef StInBound = State->assumeInBound(Idx, Size, true, T);
+    ProgramStateRef StOutBound = State->assumeInBound(Idx, Size, false, T);
     if (StOutBound && !StInBound) {
       ExplodedNode *N = C.generateSink(StOutBound);
       if (!N)





More information about the cfe-commits mailing list