From: Tom Care Date: Fri, 25 Jun 2010 18:22:31 +0000 (+0000) Subject: Change RegionStoreManager::Retrieve to infer the type of a symbolic region from the... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b050306b0ba3e7e564126fb12aca64b4c0b3f54;p=clang Change RegionStoreManager::Retrieve to infer the type of a symbolic region from the context when it is not already available. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106868 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Checker/RegionStore.cpp b/lib/Checker/RegionStore.cpp index a9d12dfb4a..f7a0188a53 100644 --- a/lib/Checker/RegionStore.cpp +++ b/lib/Checker/RegionStore.cpp @@ -1022,8 +1022,13 @@ SVal RegionStoreManager::Retrieve(Store store, Loc L, QualType T) { const MemRegion *MR = cast(L).getRegion(); - if (isa(MR) || isa(MR)) + if (isa(MR) || isa(MR)) { + if (T.isNull()) { + const SymbolicRegion *SR = cast(MR); + T = SR->getSymbol()->getType(getContext()); + } MR = GetElementZeroRegion(MR, T); + } if (isa(MR)) { assert(0 && "Why load from a code text region?");