summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-11-28 05:36:28 +0000
committerTed Kremenek <kremenek@apple.com>2012-11-28 05:36:28 +0000
commit94c83488590dc915cdbc997747854fc31ba6bea4 (patch)
tree9a1b86d117ac39cee667e4eca15a1a3937ac67d7 /clang/lib
parent48d392e81ec159657c5041856df5683f8aec627d (diff)
downloadbcm5719-llvm-94c83488590dc915cdbc997747854fc31ba6bea4.tar.gz
bcm5719-llvm-94c83488590dc915cdbc997747854fc31ba6bea4.zip
Remove workaround in RegionStore in r168741 since it is handled more generally by r168757.
llvm-svn: 168774
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/StaticAnalyzer/Core/RegionStore.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
index 875a7ce4d4e..aed994df411 100644
--- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -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.
OpenPOWER on IntegriCloud