Sfoglia il codice sorgente

[analyzer] Simplify r156446, as per Ted's review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156482 91177308-0d34-0410-b5e6-96231b3b80d8
Anna Zaks 13 anni fa
parent
commit
50b5a5c32e
1 ha cambiato i file con 2 aggiunte e 7 eliminazioni
  1. 2 7
      lib/StaticAnalyzer/Core/RegionStore.cpp

+ 2 - 7
lib/StaticAnalyzer/Core/RegionStore.cpp

@@ -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);