diff options
author | Anna Zaks <ganna@apple.com> | 2012-01-13 00:56:48 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-01-13 00:56:48 +0000 |
commit | ce8ef16b1c58a304b7b59fad9836ad32d6ed020c (patch) | |
tree | 72a19372eb9ff11e10a9077ffd712299e0fa7b4d /lib/StaticAnalyzer/Core/RegionStore.cpp | |
parent | dba241df071c4a15ac97e5cadd2d581998662809 (diff) |
[analyzer] RegionStoreManager::getBinding() should not crash when
looking up value at a CodeTextRegion even when the type is not provided.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148079 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/RegionStore.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/RegionStore.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/StaticAnalyzer/Core/RegionStore.cpp b/lib/StaticAnalyzer/Core/RegionStore.cpp index 5bd7d72675..f27c51880b 100644 --- a/lib/StaticAnalyzer/Core/RegionStore.cpp +++ b/lib/StaticAnalyzer/Core/RegionStore.cpp @@ -918,8 +918,12 @@ SVal RegionStoreManager::getBinding(Store store, Loc L, QualType T) { isa<SymbolicRegion>(MR) || isa<CodeTextRegion>(MR)) { if (T.isNull()) { - const SymbolicRegion *SR = cast<SymbolicRegion>(MR); - T = SR->getSymbol()->getType(Ctx); + if (const TypedRegion *TR = dyn_cast<TypedRegion>(MR)) + T = TR->getLocationType(); + else { + const SymbolicRegion *SR = cast<SymbolicRegion>(MR); + T = SR->getSymbol()->getType(Ctx); + } } MR = GetElementZeroRegion(MR, T); } |