aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker/FlatStore.cpp
diff options
context:
space:
mode:
authorJordy Rose <jediknil@belkadan.com>2010-08-16 01:15:17 +0000
committerJordy Rose <jediknil@belkadan.com>2010-08-16 01:15:17 +0000
commite701117b21356d3c60133315b5bdd50232ec6cca (patch)
tree73eee84d6aeb34c7ff8e34b9121638e333a13b16 /lib/Checker/FlatStore.cpp
parentc736377543edcfbb00a4150fae79b4d9d9f66849 (diff)
- Allow making ElementRegions with complex offsets (expressions or symbols) for the purpose of bounds-checking.
- Rewrite GRState::AssumeInBound to actually do that checking, and to use the normal constraint path. - Remove ConstraintManager::AssumeInBound. - Teach RegionStore and FlatStore to ignore those regions for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111116 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/FlatStore.cpp')
-rw-r--r--lib/Checker/FlatStore.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Checker/FlatStore.cpp b/lib/Checker/FlatStore.cpp
index 7c986a71df..21fa422166 100644
--- a/lib/Checker/FlatStore.cpp
+++ b/lib/Checker/FlatStore.cpp
@@ -90,8 +90,9 @@ StoreManager *clang::CreateFlatStoreManager(GRStateManager &StMgr) {
SVal FlatStoreManager::Retrieve(Store store, Loc L, QualType T) {
const MemRegion *R = cast<loc::MemRegionVal>(L).getRegion();
RegionInterval RI = RegionToInterval(R);
-
- assert(RI.R && "should handle regions with unknown interval");
+ // FIXME: FlatStore should handle regions with unknown intervals.
+ if (!RI.R)
+ return UnknownVal();
RegionBindings B = getRegionBindings(store);
const BindingVal *BV = B.lookup(RI.R);
@@ -123,7 +124,9 @@ Store FlatStoreManager::Bind(Store store, Loc L, SVal val) {
BV = *V;
RegionInterval RI = RegionToInterval(R);
- assert(RI.R && "should handle regions with unknown interval");
+ // FIXME: FlatStore should handle regions with unknown intervals.
+ if (!RI.R)
+ return B.getRoot();
BV = BVFactory.Add(BV, RI.I, val);
B = RBFactory.Add(B, RI.R, BV);
return B.getRoot();