summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker/RegionStore.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2010-06-01 04:49:26 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2010-06-01 04:49:26 +0000
commitce83656f97819b440313622c06df4ad3449edc39 (patch)
treef9144fdf0fc46a1d4d24ec207ed321858e8f21b2 /clang/lib/Checker/RegionStore.cpp
parent527ff6d1dce544b599ec904628443df1877b05d2 (diff)
downloadbcm5719-llvm-ce83656f97819b440313622c06df4ad3449edc39.tar.gz
bcm5719-llvm-ce83656f97819b440313622c06df4ad3449edc39.zip
Limit the use of BindDefault().
llvm-svn: 105265
Diffstat (limited to 'clang/lib/Checker/RegionStore.cpp')
-rw-r--r--clang/lib/Checker/RegionStore.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Checker/RegionStore.cpp b/clang/lib/Checker/RegionStore.cpp
index 1603cc81a59..d9ad02a35c4 100644
--- a/clang/lib/Checker/RegionStore.cpp
+++ b/clang/lib/Checker/RegionStore.cpp
@@ -280,8 +280,12 @@ public: // Part of public interface to class.
Store Bind(Store store, Loc LV, SVal V);
+ // BindDefault is only used to initialize a region with a default value.
Store BindDefault(Store store, const MemRegion *R, SVal V) {
- return Add(GetRegionBindings(store), R, BindingKey::Default, V).getRoot();
+ RegionBindings B = GetRegionBindings(store);
+ assert(!Lookup(B, R, BindingKey::Default));
+ assert(!Lookup(B, R, BindingKey::Direct));
+ return Add(B, R, BindingKey::Default, V).getRoot();
}
Store BindCompoundLiteral(Store store, const CompoundLiteralExpr* CL,
OpenPOWER on IntegriCloud