[llvm] [LLVM][DWARF] Fix for memory leak (PR #81828)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 09:45:01 PST 2024


================
@@ -251,7 +251,10 @@ class Dwarf5AccelTableWriter : public AccelTableWriter {
           const DWARF5AccelTableData &)>
           getIndexForEntry,
       bool IsSplitDwarf);
-
+  ~Dwarf5AccelTableWriter() {
+    for (DebugNamesAbbrev *Abbrev : AbbreviationsVector)
+      Abbrev->~DebugNamesAbbrev();
+  }
----------------
vitalybuka wrote:

I am going to accept and land to fix the bot.
Please followup with @felipepiovezan .

BTW. `std::destroy` should work here

https://github.com/llvm/llvm-project/pull/81828


More information about the llvm-commits mailing list