summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/RegionStore.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-01-22 23:56:56 +0000
committerTed Kremenek <kremenek@apple.com>2009-01-22 23:56:56 +0000
commit2e1dfe25c5251f2ea39c8492d917e9873b7168e7 (patch)
treefe59affa0a7a0fb0f18ab8cc6b479718bd54536f /clang/lib/Analysis/RegionStore.cpp
parent34eab390b97ca0ac10eeffb0134eced897d1a9a6 (diff)
downloadbcm5719-llvm-2e1dfe25c5251f2ea39c8492d917e9873b7168e7.tar.gz
bcm5719-llvm-2e1dfe25c5251f2ea39c8492d917e9873b7168e7.zip
For now, return UnknownVal() in RegionStore::getElementsSize() for AnonTypedRegions. It wasn't really doing the right thing and was crashing on rdar-6442306-1.m. This fix causes all path-sensitive test cases to pass with RegionStore.
llvm-svn: 62816
Diffstat (limited to 'clang/lib/Analysis/RegionStore.cpp')
-rw-r--r--clang/lib/Analysis/RegionStore.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp
index ec801d47f28..48c11f3bbf1 100644
--- a/clang/lib/Analysis/RegionStore.cpp
+++ b/clang/lib/Analysis/RegionStore.cpp
@@ -420,6 +420,12 @@ SVal RegionStoreManager::getSizeInElements(const GRState* St,
}
if (const AnonTypedRegion* ATR = dyn_cast<AnonTypedRegion>(R)) {
+#if 0
+ // FIXME: This logic doesn't really work, as we can have all sorts of
+ // weird cases. For example, this crashes on test case 'rdar-6442306-1.m'.
+ // The weird cases come in when arbitrary casting comes into play, violating
+ // any type-safe programming.
+
GRStateRef state(St, StateMgr);
// Get the size of the super region in bytes.
@@ -450,6 +456,10 @@ SVal RegionStoreManager::getSizeInElements(const GRState* St,
(SSize * getBasicVals().getValue(8, SSize.getBitWidth(), false)) / ESize;
return NonLoc::MakeVal(getBasicVals(), S);
+#else
+ ATR = ATR;
+ return UnknownVal();
+#endif
}
if (const FieldRegion* FR = dyn_cast<FieldRegion>(R)) {
OpenPOWER on IntegriCloud