From 375387d1f81872a991f52edcedc0730d1b90f937 Mon Sep 17 00:00:00 2001 From: Tom Care Date: Fri, 25 Jun 2010 18:22:31 +0000 Subject: [PATCH] Change RegionStoreManager::Retrieve to infer the type of a symbolic region from the context when it is not already available. llvm-svn: 106868 --- clang/lib/Checker/RegionStore.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/clang/lib/Checker/RegionStore.cpp b/clang/lib/Checker/RegionStore.cpp index a9d12dfb4a98..f7a0188a5319 100644 --- a/clang/lib/Checker/RegionStore.cpp +++ b/clang/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?");