diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-12-09 23:50:57 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-12-09 23:50:57 +0000 |
commit | 42a217f4c01137004382df81f2b81a6fcf39ac56 (patch) | |
tree | ec5a43e114d0f096cc4432a81be379ad78a1ed5c /clang | |
parent | 8008cb9a770efbd58d9716f020f6e082fb10fdf5 (diff) | |
download | bcm5719-llvm-42a217f4c01137004382df81f2b81a6fcf39ac56.tar.gz bcm5719-llvm-42a217f4c01137004382df81f2b81a6fcf39ac56.zip |
Fix to BasicStoreManager::getElementLValue: If the base region is a symbol, layer an AnonTypedRegion on top of it.
llvm-svn: 60808
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Analysis/BasicStore.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/clang/lib/Analysis/BasicStore.cpp b/clang/lib/Analysis/BasicStore.cpp index 31d392e80f4..207f6096090 100644 --- a/clang/lib/Analysis/BasicStore.cpp +++ b/clang/lib/Analysis/BasicStore.cpp @@ -174,9 +174,20 @@ SVal BasicStoreManager::getLValueElement(const GRState* St, SVal Base, const MemRegion* BaseR = 0; switch(BaseL.getSubKind()) { - case loc::SymbolValKind: - BaseR = MRMgr.getSymbolicRegion(cast<loc::SymbolVal>(&BaseL)->getSymbol()); + case loc::SymbolValKind: { + // FIXME: Should we have symbolic regions be typed or typeless? + // Here we assume that these regions are typeless, even though the + // symbol is typed. + SymbolRef Sym = cast<loc::SymbolVal>(&BaseL)->getSymbol(); + // Create a region to represent this symbol. + // FIXME: In the future we may just use symbolic regions instead of + // SymbolVals to reason about symbolic memory chunks. + const MemRegion* SymR = MRMgr.getSymbolicRegion(Sym); + // Layered a typed region on top of this. + QualType T = StateMgr.getSymbolManager().getType(Sym); + BaseR = MRMgr.getAnonTypedRegion(T, SymR); break; + } case loc::GotoLabelKind: case loc::FuncValKind: |