diff options
author | Tom Care <tcare@apple.com> | 2010-06-25 18:22:31 +0000 |
---|---|---|
committer | Tom Care <tcare@apple.com> | 2010-06-25 18:22:31 +0000 |
commit | 375387d1f81872a991f52edcedc0730d1b90f937 (patch) | |
tree | 2128c9c9494d1c35e53b789ff1f72e46e209cdaa /clang/lib/Checker/RegionStore.cpp | |
parent | e76c0b13b9133dba8f7af05ec091744b1460d77a (diff) | |
download | bcm5719-llvm-375387d1f81872a991f52edcedc0730d1b90f937.tar.gz bcm5719-llvm-375387d1f81872a991f52edcedc0730d1b90f937.zip |
Change RegionStoreManager::Retrieve to infer the type of a symbolic region from the context when it is not already available.
llvm-svn: 106868
Diffstat (limited to 'clang/lib/Checker/RegionStore.cpp')
-rw-r--r-- | clang/lib/Checker/RegionStore.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Checker/RegionStore.cpp b/clang/lib/Checker/RegionStore.cpp index a9d12dfb4a9..f7a0188a531 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<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?"); |