summaryrefslogtreecommitdiffstats
path: root/clang/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
commitd4e72fca45694d3eb5245648b59d96b01729e672 (patch)
treeafedb8843a4fcdca0863480829f03b526997f682 /clang/lib/Analysis/RegionStore.cpp
parente9857ddcc087079ba4320738fbc1a4c699e30c22 (diff)
downloadbcm5719-llvm-d4e72fca45694d3eb5245648b59d96b01729e672.tar.gz
bcm5719-llvm-d4e72fca45694d3eb5245648b59d96b01729e672.zip
Process array base expression of any type.
llvm-svn: 59240
Diffstat (limited to 'clang/lib/Analysis/RegionStore.cpp')
-rw-r--r--clang/lib/Analysis/RegionStore.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp
index ec5acf57f4e..b09c49ec093 100644
--- a/clang/lib/Analysis/RegionStore.cpp
+++ b/clang/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());
OpenPOWER on IntegriCloud