diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-06-01 04:49:26 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-06-01 04:49:26 +0000 |
commit | 54460091f3987cda47a2604b07a9fb4642068dda (patch) | |
tree | eec37eb75b5f0eb19fa4b516ce0106de886c93d5 /lib/Checker/RegionStore.cpp | |
parent | a5ce966d1a23d84aa5e849cf0ed62494e736ea6a (diff) |
Limit the use of BindDefault().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105265 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/RegionStore.cpp')
-rw-r--r-- | lib/Checker/RegionStore.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Checker/RegionStore.cpp b/lib/Checker/RegionStore.cpp index 1603cc81a5..d9ad02a35c 100644 --- a/lib/Checker/RegionStore.cpp +++ b/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, |