Author: nico
Date: Tue May 6 12:18:03 2014
New Revision: 208108
URL: http://llvm.org/viewvc/llvm-project?rev=208108&view=rev
Log:
Fix a leak found by LSan: ConsumedBlockInfo owns its StateMapsArray entries.
(I tried converting StateMapsArray to a vector<unique_ptr> and changing the
types of getInfo() and addInfo() to take unique_ptrs. This mostly worked,
except for the three-argument form of addInfo() which I found confusing enough
that I went with this simpler fix for now.)
Modified:
cfe/trunk/include/clang/Analysis/Analyses/Consumed.h
Modified: cfe/trunk/include/clang/Analysis/Analyses/Consumed.h
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/Analyses/Consumed.h?rev=208108&r1=208107&r2=208108&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/Analyses/Consumed.h (original)
+++ cfe/trunk/include/clang/Analysis/Analyses/Consumed.h Tue May 6 12:18:03
2014
@@ -201,7 +201,8 @@ namespace consumed {
public:
ConsumedBlockInfo() { }
-
+ ~ConsumedBlockInfo() { llvm::DeleteContainerPointers(StateMapsArray); }
+
ConsumedBlockInfo(unsigned int NumBlocks, PostOrderCFGView *SortedGraph)
: StateMapsArray(NumBlocks, nullptr), VisitOrder(NumBlocks, 0) {
unsigned int VisitOrderCounter = 0;
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits