diff options
| author | Ted Kremenek <kremenek@apple.com> | 2009-03-30 22:20:54 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2009-03-30 22:20:54 +0000 |
| commit | 7857bd2743096639529c4a6144135e5dd18a8a8c (patch) | |
| tree | e21b1b34739c06cc7a45cc3b3610c543f1b42411 /clang/lib/Analysis/RegionStore.cpp | |
| parent | cbe5b2f8008c9dfe151b972e209244befa394d6a (diff) | |
| download | bcm5719-llvm-7857bd2743096639529c4a6144135e5dd18a8a8c.tar.gz bcm5719-llvm-7857bd2743096639529c4a6144135e5dd18a8a8c.zip | |
Re-apply 68028. The code had drifted enough that the tests would fail without
it. Will discuss offline whether symbolic regions should by typed or typeless.
llvm-svn: 68070
Diffstat (limited to 'clang/lib/Analysis/RegionStore.cpp')
| -rw-r--r-- | clang/lib/Analysis/RegionStore.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp index 60948062f6f..0b2d99b29b1 100644 --- a/clang/lib/Analysis/RegionStore.cpp +++ b/clang/lib/Analysis/RegionStore.cpp @@ -362,9 +362,13 @@ SVal RegionStoreManager::getLValueFieldOrIvar(const GRState* St, SVal Base, BaseR = cast<loc::MemRegionVal>(BaseL).getRegion(); break; - case loc::SymbolValKind: - BaseR = MRMgr.getSymbolicRegion(cast<loc::SymbolVal>(&BaseL)->getSymbol()); + case loc::SymbolValKind: { + SymbolRef Sym = cast<loc::SymbolVal>(&BaseL)->getSymbol(); + const SymbolicRegion* SR = MRMgr.getSymbolicRegion(Sym); + // Layer the type information. + BaseR = MRMgr.getTypedViewRegion(Sym->getType(getContext()), SR); break; + } case loc::GotoLabelKind: case loc::FuncValKind: @@ -407,9 +411,14 @@ SVal RegionStoreManager::getLValueElement(const GRState* St, const TypedRegion* BaseRegion = 0; - BaseRegion = isa<loc::SymbolVal>(Base) - ? MRMgr.getSymbolicRegion(cast<loc::SymbolVal>(Base).getSymbol()) - : cast<TypedRegion>(cast<loc::MemRegionVal>(Base).getRegion()); + if (isa<loc::SymbolVal>(Base)) { + SymbolRef Sym = cast<loc::SymbolVal>(Base).getSymbol(); + SymbolicRegion* SR = MRMgr.getSymbolicRegion(Sym); + // Layer the type information. + BaseRegion = MRMgr.getTypedViewRegion(Sym->getType(getContext()), SR); + } + else + BaseRegion = cast<TypedRegion>(cast<loc::MemRegionVal>(Base).getRegion()); // Pointer of any type can be cast and used as array base. const ElementRegion *ElemR = dyn_cast<ElementRegion>(BaseRegion); |

