diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-06-01 03:01:33 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-06-01 03:01:33 +0000 |
commit | a5ce966d1a23d84aa5e849cf0ed62494e736ea6a (patch) | |
tree | a959f62528c9d8179a6b5be225eeb23e3f9d319a /lib/Checker/RegionStore.cpp | |
parent | 681e256048cf9d3d226b9d0699f3df22c2500ef4 (diff) |
Add support for calloc() in MallocChecker. Patch by Jordy Rose, with my
modification.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105264 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/RegionStore.cpp')
-rw-r--r-- | lib/Checker/RegionStore.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Checker/RegionStore.cpp b/lib/Checker/RegionStore.cpp index ddcb7bee49..1603cc81a5 100644 --- a/lib/Checker/RegionStore.cpp +++ b/lib/Checker/RegionStore.cpp @@ -280,6 +280,10 @@ public: // Part of public interface to class. Store Bind(Store store, Loc LV, SVal V); + Store BindDefault(Store store, const MemRegion *R, SVal V) { + return Add(GetRegionBindings(store), R, BindingKey::Default, V).getRoot(); + } + Store BindCompoundLiteral(Store store, const CompoundLiteralExpr* CL, const LocationContext *LC, SVal V); @@ -1233,7 +1237,7 @@ SVal RegionStoreManager::RetrieveFieldOrElementCommon(Store store, if (D->isZeroConstant()) return ValMgr.makeZeroVal(Ty); - if (D->isUnknown()) + if (D->isUnknownOrUndef()) return *D; assert(0 && "Unknown default value"); @@ -1456,6 +1460,7 @@ Store RegionStoreManager::BindCompoundLiteral(Store store, V); } + Store RegionStoreManager::setImplicitDefaultValue(Store store, const MemRegion *R, QualType T) { |