[cfe-commits] r168774 - /cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp

Ted Kremenek kremenek at apple.com
Tue Nov 27 21:36:29 PST 2012


Author: kremenek
Date: Tue Nov 27 23:36:28 2012
New Revision: 168774

URL: http://llvm.org/viewvc/llvm-project?rev=168774&view=rev
Log:
Remove workaround in RegionStore in r168741 since it is handled more generally by r168757.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp?rev=168774&r1=168773&r2=168774&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp Tue Nov 27 23:36:28 2012
@@ -1581,16 +1581,14 @@
     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.





More information about the cfe-commits mailing list