From: Ted Kremenek Date: Wed, 28 Nov 2012 05:36:28 +0000 (+0000) Subject: Remove workaround in RegionStore in r168741 since it is handled more generally by... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3881866dc782c5e13b21031bd363e93fbf367167;p=clang Remove workaround in RegionStore in r168741 since it is handled more generally by r168757. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168774 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Core/RegionStore.cpp b/lib/StaticAnalyzer/Core/RegionStore.cpp index 875a7ce4d4..aed994df41 100644 --- a/lib/StaticAnalyzer/Core/RegionStore.cpp +++ b/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(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(Reg)); - return BindAggregate(store, R, UnknownVal()); + if (loc::MemRegionVal *MRV = dyn_cast(&Init)) { + const StringRegion *S = cast(MRV->getRegion()); + + // Treat the string as a lazy compound value. + nonloc::LazyCompoundVal LCV = + cast(svalBuilder. + makeLazyCompoundVal(StoreRef(store, *this), S)); + return BindAggregate(store, R, LCV); } // Handle lazy compound values.