aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/RegionStore.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-07-02 22:02:15 +0000
committerTed Kremenek <kremenek@apple.com>2009-07-02 22:02:15 +0000
commitdc147262b1ea0636cf8e7152f19303042dffdbed (patch)
treeb922bba47fa63d08a8f902753f5c009b9f8716c0 /lib/Analysis/RegionStore.cpp
parent41e8c21eb41fca41e2e065e75f01433427858c19 (diff)
Enhance RegionStore to lazily symbolicate fields and array elements for
structures passed-by-value as function arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74729 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RegionStore.cpp')
-rw-r--r--lib/Analysis/RegionStore.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index 9c76265fa3..5729103fd3 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -959,7 +959,7 @@ SVal RegionStoreManager::RetrieveElement(const GRState* state,
return UndefinedVal();
}
- if (R->hasStackStorage()) {
+ if (R->hasStackStorage() && !R->hasParametersStorage()) {
// Currently we don't reason specially about Clang-style vectors. Check
// if superR is a vector and if so return Unknown.
if (const TypedRegion *typedSuperR = dyn_cast<TypedRegion>(superR)) {
@@ -1006,7 +1006,11 @@ SVal RegionStoreManager::RetrieveField(const GRState* state,
assert(0 && "Unknown default value");
}
- if (R->hasHeapOrStackStorage())
+ // FIXME: Is this correct? Should it be UnknownVal?
+ if (R->hasHeapStorage())
+ return UndefinedVal();
+
+ if (R->hasStackStorage() && !R->hasParametersStorage())
return UndefinedVal();
// If the region is already cast to another type, use that type to create the