[llvm] r238418 - [AsmPrinter] Destroy allocated DIEAbbrevs on teardown.
Benjamin Kramer
benny.kra at GOOGLEMAIL.com
Thu May 28 05:55:43 PDT 2015
Author: d0k
Date: Thu May 28 07:55:43 2015
New Revision: 238418
URL: http://llvm.org/viewvc/llvm-project?rev=238418&view=rev
Log:
[AsmPrinter] Destroy allocated DIEAbbrevs on teardown.
DIEAbbrev contains a SmallVector that can leak for overly large abbrevs. They
used to be owned by the DIE, but after the recent refactoring DWARFFile
allocates its own abbrevs.
Leak found by asan.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.cpp?rev=238418&r1=238417&r2=238418&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.cpp Thu May 28 07:55:43 2015
@@ -20,7 +20,10 @@ namespace llvm {
DwarfFile::DwarfFile(AsmPrinter *AP, StringRef Pref, BumpPtrAllocator &DA)
: Asm(AP), StrPool(DA, *Asm, Pref) {}
-DwarfFile::~DwarfFile() {}
+DwarfFile::~DwarfFile() {
+ for (DIEAbbrev *Abbrev : Abbreviations)
+ Abbrev->~DIEAbbrev();
+}
// Define a unique number for the abbreviation.
//
More information about the llvm-commits
mailing list