]> granicus.if.org Git - clang/commitdiff
Change RegionStoreManager::Retrieve to infer the type of a symbolic region from the...
authorTom Care <tcare@apple.com>
Fri, 25 Jun 2010 18:22:31 +0000 (18:22 +0000)
committerTom Care <tcare@apple.com>
Fri, 25 Jun 2010 18:22:31 +0000 (18:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106868 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/RegionStore.cpp

index a9d12dfb4a980a03b58e11fffc424c65a9662f66..f7a0188a5319cde34666322eb26d93947f4b46fa 100644 (file)
@@ -1022,8 +1022,13 @@ SVal RegionStoreManager::Retrieve(Store store, Loc L, QualType T) {
 
   const MemRegion *MR = cast<loc::MemRegionVal>(L).getRegion();
 
-  if (isa<AllocaRegion>(MR) || isa<SymbolicRegion>(MR))
+  if (isa<AllocaRegion>(MR) || isa<SymbolicRegion>(MR)) {
+    if (T.isNull()) {
+      const SymbolicRegion *SR = cast<SymbolicRegion>(MR);
+      T = SR->getSymbol()->getType(getContext());
+    }
     MR = GetElementZeroRegion(MR, T);
+  }
 
   if (isa<CodeTextRegion>(MR)) {
     assert(0 && "Why load from a code text region?");