[cfe-commits] r71488 - /cfe/trunk/lib/Analysis/CFRefCount.cpp

Ted Kremenek kremenek at apple.com
Mon May 11 15:55:17 PDT 2009


Author: kremenek
Date: Mon May 11 17:55:17 2009
New Revision: 71488

URL: http://llvm.org/viewvc/llvm-project?rev=71488&view=rev
Log:
When stripping element regions for invalidating region values, treat FieldRegions and ObjCIvarRegions as "base" regions in addition to VarRegions.

Modified:
    cfe/trunk/lib/Analysis/CFRefCount.cpp

Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=71488&r1=71487&r2=71488&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Mon May 11 17:55:17 2009
@@ -2673,10 +2673,13 @@
             // approriately delegated to the respective StoreManagers while
             // still allowing us to do checker-specific logic (e.g.,
             // invalidating reference counts), probably via callbacks.            
-            if (ER->getElementType()->isIntegralType())
-              if (const VarRegion *superReg =
-                  dyn_cast<VarRegion>(ER->getSuperRegion()))
-                R = superReg;
+            if (ER->getElementType()->isIntegralType()) {
+              const MemRegion *superReg = ER->getSuperRegion();
+              if (isa<VarRegion>(superReg) || isa<FieldRegion>(superReg) ||
+                  isa<ObjCIvarRegion>(superReg))
+                R = cast<TypedRegion>(superReg);
+            }
+
             // FIXME: What about layers of ElementRegions?
           }
           





More information about the cfe-commits mailing list