aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/RegionStore.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2008-11-13 09:48:44 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2008-11-13 09:48:44 +0000
commite4d139374c64e7cf4ef29517076be691a71e1c23 (patch)
tree368d5b26ca0beefa1f0b40801d5ae5e386d95bfa /lib/Analysis/RegionStore.cpp
parent26134a1b596b9763a6975f15bf296a580b141114 (diff)
Process array base expression of any type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59240 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RegionStore.cpp')
-rw-r--r--lib/Analysis/RegionStore.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index ec5acf57f4..b09c49ec09 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -186,6 +186,14 @@ SVal RegionStoreManager::getLValueElement(const GRState* St,
loc::MemRegionVal& BaseL = cast<loc::MemRegionVal>(Base);
+ // Pointer of any type can be cast and used as array base. We do not support
+ // that case yet.
+ if (!isa<ElementRegion>(BaseL.getRegion())) {
+ // Record what we have seen in real code.
+ assert(isa<FieldRegion>(BaseL.getRegion()));
+ return UnknownVal();
+ }
+
// We expect BaseR is an ElementRegion, not a base VarRegion.
const ElementRegion* ElemR = cast<ElementRegion>(BaseL.getRegion());