]> granicus.if.org Git - clang/commitdiff
[analyzer] Simplify r156446, as per Ted's review.
authorAnna Zaks <ganna@apple.com>
Wed, 9 May 2012 17:23:15 +0000 (17:23 +0000)
committerAnna Zaks <ganna@apple.com>
Wed, 9 May 2012 17:23:15 +0000 (17:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156482 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/RegionStore.cpp

index 487327e7fcb0e7dba36985c709ccfb9df7311d63..1b941cc680b0a22c666595642885b740ba269eb1 100644 (file)
@@ -1154,13 +1154,8 @@ RegionStoreManager::GetLazyBinding(RegionBindings B, const MemRegion *R,
 SVal RegionStoreManager::getBindingForElement(Store store,
                                               const ElementRegion* R) {
   // We do not currently model bindings of the CompoundLiteralregion.
-  const ElementRegion *Tmp = R;
-  while (Tmp) {
-    const MemRegion *Sup = Tmp->getSuperRegion();
-    if (isa<CompoundLiteralRegion>(Sup))
-      return UnknownVal();
-    Tmp = dyn_cast<ElementRegion>(Sup);
-  }
+  if (isa<CompoundLiteralRegion>(R->getBaseRegion()))
+    return UnknownVal();
 
   // Check if the region has a binding.
   RegionBindings B = GetRegionBindings(store);