forked from OSchip/llvm-project
[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
This commit is contained in:
parent
e749b20171
commit
5188a2af72
|
@ -20,7 +20,10 @@ namespace llvm {
|
||||||
DwarfFile::DwarfFile(AsmPrinter *AP, StringRef Pref, BumpPtrAllocator &DA)
|
DwarfFile::DwarfFile(AsmPrinter *AP, StringRef Pref, BumpPtrAllocator &DA)
|
||||||
: Asm(AP), StrPool(DA, *Asm, Pref) {}
|
: Asm(AP), StrPool(DA, *Asm, Pref) {}
|
||||||
|
|
||||||
DwarfFile::~DwarfFile() {}
|
DwarfFile::~DwarfFile() {
|
||||||
|
for (DIEAbbrev *Abbrev : Abbreviations)
|
||||||
|
Abbrev->~DIEAbbrev();
|
||||||
|
}
|
||||||
|
|
||||||
// Define a unique number for the abbreviation.
|
// Define a unique number for the abbreviation.
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue