]> granicus.if.org Git - clang/commitdiff
Remove some uses of TypedViewRegion, and use getBaseRegion() in a context where
authorTed Kremenek <kremenek@apple.com>
Wed, 29 Jul 2009 18:17:40 +0000 (18:17 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 29 Jul 2009 18:17:40 +0000 (18:17 +0000)
we don't care about ElementRegions layered on top of a base region.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77484 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BasicObjCFoundationChecks.cpp
lib/Analysis/CFRefCount.cpp

index 76203779875351223cbf21c2e4181a3e503dc533..684c88c998753856f990457fe1141109cafb2ad6 100644 (file)
@@ -394,14 +394,11 @@ bool AuditCFNumberCreate::Audit(ExplodedNode<GRState>* N,GRStateManager&){
   if (!LV)
     return false;
   
-  const TypedRegion* R = dyn_cast<TypedRegion>(LV->getRegion());
-  if (!R) return false;
-  
-  while (const TypedViewRegion* ATR = dyn_cast<TypedViewRegion>(R)) {
-    R = dyn_cast<TypedRegion>(ATR->getSuperRegion());
-    if (!R) return false;
-  }
-  
+  const TypedRegion* R = dyn_cast<TypedRegion>(LV->getBaseRegion());
+
+  if (!R)
+    return false;
+
   QualType T = Ctx.getCanonicalType(R->getValueType(Ctx));
   
   // FIXME: If the pointee isn't an integer type, should we flag a warning?
index 04f9cb82a207891140225fda678c31d5aeaac88e..78d1a8b3e571299e0d9570c39267c4b1d05381e9 100644 (file)
@@ -3023,7 +3023,7 @@ void CFRefCount::EvalObjCMessageExpr(ExplodedNodeSet<GRState>& Dst,
       if (Expr* Receiver = ME->getReceiver()) {
         SVal X = St->getSValAsScalarOrLoc(Receiver);
         if (loc::MemRegionVal* L = dyn_cast<loc::MemRegionVal>(&X))
-          if (L->getRegion() == St->getSelfRegion()) {
+          if (L->getBaseRegion() == St->getSelfRegion()) {
             // Update the summary to make the default argument effect
             // 'StopTracking'.
             Summ = Summaries.copySummary(Summ);