diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-05-28 12:55:43 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-05-28 12:55:43 +0000 |
| commit | 5188a2af721ff821aee387bd2de5d43c76b431c8 (patch) | |
| tree | f46af812c0ca016ced9bb90ba66946cad9c8fb08 /llvm/lib | |
| parent | e749b20171faf5a0e071a854c30873fbbd5dcbd6 (diff) | |
| download | bcm5719-llvm-5188a2af721ff821aee387bd2de5d43c76b431c8.tar.gz bcm5719-llvm-5188a2af721ff821aee387bd2de5d43c76b431c8.zip | |
[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.
llvm-svn: 238418
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp index cafaabba5a3..1060366a8ba 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp @@ -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. // |

