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 | 527ff6d1dce544b599ec904628443df1877b05d2 (patch) | |
tree | 2b6c35ba452f192b131504a5b3a4a04a11fc1f20 /clang/lib/Checker/RegionStore.cpp | |
parent | 1a764f93a0fc3f0bd45fb4e839e1dce7637cc8ec (diff) | |
download | bcm5719-llvm-527ff6d1dce544b599ec904628443df1877b05d2.tar.gz bcm5719-llvm-527ff6d1dce544b599ec904628443df1877b05d2.zip |
Add support for calloc() in MallocChecker. Patch by Jordy Rose, with my
modification.
llvm-svn: 105264
Diffstat (limited to 'clang/lib/Checker/RegionStore.cpp')
-rw-r--r-- | clang/lib/Checker/RegionStore.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Checker/RegionStore.cpp b/clang/lib/Checker/RegionStore.cpp index ddcb7bee494..1603cc81a59 100644 --- a/clang/lib/Checker/RegionStore.cpp +++ b/clang/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) { |