diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-03-08 23:18:00 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-03-08 23:18:00 +0000 |
commit | cf333339615da345c2ed6e873d94a501810d9f3f (patch) | |
tree | 47bbfb278ca47c5278426006a7218aaaf2240ff6 /lib/StaticAnalyzer/Core/BasicValueFactory.cpp | |
parent | 15987970eeaa1842c29ec8797affd1c1dea05585 (diff) |
static analyzer: Fix use-after-free bug in RegionStore involving LazyCompoundValueData not reference counting Store objects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127288 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/BasicValueFactory.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/BasicValueFactory.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/StaticAnalyzer/Core/BasicValueFactory.cpp b/lib/StaticAnalyzer/Core/BasicValueFactory.cpp index 6315d83d89..d29c86adcf 100644 --- a/lib/StaticAnalyzer/Core/BasicValueFactory.cpp +++ b/lib/StaticAnalyzer/Core/BasicValueFactory.cpp @@ -25,8 +25,9 @@ void CompoundValData::Profile(llvm::FoldingSetNodeID& ID, QualType T, } void LazyCompoundValData::Profile(llvm::FoldingSetNodeID& ID, - const void *store,const TypedRegion *region) { - ID.AddPointer(store); + const StoreRef &store, + const TypedRegion *region) { + ID.AddPointer(store.getStore()); ID.AddPointer(region); } @@ -124,7 +125,7 @@ BasicValueFactory::getCompoundValData(QualType T, } const LazyCompoundValData* -BasicValueFactory::getLazyCompoundValData(const void *store, +BasicValueFactory::getLazyCompoundValData(const StoreRef &store, const TypedRegion *region) { llvm::FoldingSetNodeID ID; LazyCompoundValData::Profile(ID, store, region); |