[cfe-commits] r105265 - /cfe/trunk/lib/Checker/RegionStore.cpp
Zhongxing Xu
xuzhongxing at gmail.com
Mon May 31 21:49:27 PDT 2010
Author: zhongxingxu
Date: Mon May 31 23:49:26 2010
New Revision: 105265
URL: http://llvm.org/viewvc/llvm-project?rev=105265&view=rev
Log:
Limit the use of BindDefault().
Modified:
cfe/trunk/lib/Checker/RegionStore.cpp
Modified: cfe/trunk/lib/Checker/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/RegionStore.cpp?rev=105265&r1=105264&r2=105265&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/RegionStore.cpp (original)
+++ cfe/trunk/lib/Checker/RegionStore.cpp Mon May 31 23:49:26 2010
@@ -280,8 +280,12 @@
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,
More information about the cfe-commits
mailing list