From df28e8ec4145fbe407f09dc2458d42cd9f12bd99 Mon Sep 17 00:00:00 2001 From: Jordy Rose Date: Mon, 16 Aug 2010 01:15:17 +0000 Subject: - 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. llvm-svn: 111116 --- clang/lib/Checker/FlatStore.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'clang/lib/Checker/FlatStore.cpp') diff --git a/clang/lib/Checker/FlatStore.cpp b/clang/lib/Checker/FlatStore.cpp index 7c986a71df5..21fa422166f 100644 --- a/clang/lib/Checker/FlatStore.cpp +++ b/clang/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(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(); -- cgit v1.2.3