]> granicus.if.org Git - clang/commitdiff
Remove workaround in RegionStore in r168741 since it is handled more generally by...
authorTed Kremenek <kremenek@apple.com>
Wed, 28 Nov 2012 05:36:28 +0000 (05:36 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 28 Nov 2012 05:36:28 +0000 (05:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168774 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/RegionStore.cpp

index 875a7ce4d4e42215e23dd8eb7713de428a7ed64a..aed994df4110e442c2bf02827c7410f6266f7b0b 100644 (file)
@@ -1581,16 +1581,14 @@ StoreRef RegionStoreManager::BindArray(Store store, const TypedValueRegion* R,
     Size = CAT->getSize().getZExtValue();
 
   // Check if the init expr is a string literal.
-  if (const MemRegion *Reg = Init.getAsRegion()) {
-    if (const StringRegion *S = dyn_cast<StringRegion>(Reg)) {
-      // Treat the string as a lazy compound value.
-      NonLoc V = svalBuilder.makeLazyCompoundVal(StoreRef(store, *this), S);
-      return BindAggregate(store, R, V);
-    }
-    // FIXME: Handle CXXTempObjectRegion, which can occur in cases
-    // where a struct contains an array of structs in C++.
-    assert(isa<CXXTempObjectRegion>(Reg));
-    return BindAggregate(store, R, UnknownVal());
+  if (loc::MemRegionVal *MRV = dyn_cast<loc::MemRegionVal>(&Init)) {
+    const StringRegion *S = cast<StringRegion>(MRV->getRegion());
+
+    // Treat the string as a lazy compound value.
+    nonloc::LazyCompoundVal LCV =
+      cast<nonloc::LazyCompoundVal>(svalBuilder.
+                                makeLazyCompoundVal(StoreRef(store, *this), S));
+    return BindAggregate(store, R, LCV);
   }
 
   // Handle lazy compound values.