From: Zhongxing Xu Date: Tue, 1 Jun 2010 04:49:26 +0000 (+0000) Subject: Limit the use of BindDefault(). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54460091f3987cda47a2604b07a9fb4642068dda;p=clang Limit the use of BindDefault(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105265 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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,