summaryrefslogtreecommitdiffstats
path: root/clang/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
commit725b4a3a51825863cdeb44ba0d6f1f25a2339091 (patch)
tree01be1d6f015e84d3d380e97a7696d66862eb66e8 /clang/lib/Analysis/RegionStore.cpp
parent73f3611be941b3b25fede1f45913d72d2b3e91b4 (diff)
downloadbcm5719-llvm-725b4a3a51825863cdeb44ba0d6f1f25a2339091.tar.gz
bcm5719-llvm-725b4a3a51825863cdeb44ba0d6f1f25a2339091.zip
Enhance RegionStore to lazily symbolicate fields and array elements for
structures passed-by-value as function arguments. llvm-svn: 74729
Diffstat (limited to 'clang/lib/Analysis/RegionStore.cpp')
-rw-r--r--clang/lib/Analysis/RegionStore.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp
index 9c76265fa39..5729103fd3a 100644
--- a/clang/lib/Analysis/RegionStore.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud