aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/BasicStore.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-12-09 23:50:57 +0000
committerTed Kremenek <kremenek@apple.com>2008-12-09 23:50:57 +0000
commit1d6c14bd27ee4945aa453ab2e8d2b3dfca374318 (patch)
tree8e8a7b505286afa6fab0c9deb3fcdb3844c176d4 /lib/Analysis/BasicStore.cpp
parent91b51a92f2e9fc8025b6a9df88442840eb62823a (diff)
Fix to BasicStoreManager::getElementLValue: If the base region is a symbol, layer an AnonTypedRegion on top of it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60808 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BasicStore.cpp')
-rw-r--r--lib/Analysis/BasicStore.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp
index 31d392e80f..207f609609 100644
--- a/lib/Analysis/BasicStore.cpp
+++ b/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: