From 4bb6c6b37ed03f47fb07e1694e51c8a81ae3b33e Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 8 Mar 2011 23:18:00 +0000 Subject: static analyzer: Fix use-after-free bug in RegionStore involving LazyCompoundValueData not reference counting Store objects. llvm-svn: 127288 --- clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp') diff --git a/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp b/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp index 6315d83d894..d29c86adcfa 100644 --- a/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp +++ b/clang/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); -- cgit v1.2.3