aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/RegionStore.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-12-11 06:43:27 +0000
committerTed Kremenek <kremenek@apple.com>2009-12-11 06:43:27 +0000
commit2b87ae45e129b941d0a4d221c9d4842385a119bd (patch)
tree25d052be3aaf688c995b9292988d2fe4a8a125cd /lib/Analysis/RegionStore.cpp
parenta49c6b7da5684e061612de70b62fe892b67f35c4 (diff)
Enhance understanding of VarRegions referenced by a block whose declarations are outside the current stack frame. Fixes <rdar://problem/7462324>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91107 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RegionStore.cpp')
-rw-r--r--lib/Analysis/RegionStore.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index c718f1fbba..b5eeb1ea11 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -728,6 +728,7 @@ DefinedOrUnknownSVal RegionStoreManager::getSizeInElements(const GRState *state,
case MemRegion::StackArgumentsSpaceRegionKind:
case MemRegion::HeapSpaceRegionKind:
case MemRegion::GlobalsSpaceRegionKind:
+ case MemRegion::UnknownSpaceRegionKind:
assert(0 && "Cannot index into a MemSpace");
return UnknownVal();
@@ -881,6 +882,7 @@ SVal RegionStoreManager::EvalBinOp(const GRState *state,
case MemRegion::StackArgumentsSpaceRegionKind:
case MemRegion::HeapSpaceRegionKind:
case MemRegion::GlobalsSpaceRegionKind:
+ case MemRegion::UnknownSpaceRegionKind:
assert(0 && "Cannot perform pointer arithmetic on a MemSpace");
return UnknownVal();
}
@@ -1292,7 +1294,8 @@ SVal RegionStoreManager::RetrieveVar(const GRState *state,
// Lazily derive a value for the VarRegion.
const VarDecl *VD = R->getDecl();
- if (R->hasGlobalsOrParametersStorage())
+ if (R->hasGlobalsOrParametersStorage() ||
+ isa<UnknownSpaceRegion>(R->getMemorySpace()))
return ValMgr.getRegionValueSymbolValOrUnknown(R, VD->getType());
return UndefinedVal();