[llvm] 85b7b56 - Fix memory leak in 4318028cd2d7633a0cdeb0b5d4d2ed81fab87864

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 28 12:09:20 PST 2021


Author: David Blaikie
Date: 2021-01-28T12:08:23-08:00
New Revision: 85b7b5625a009c738cec626cd5b02cd04d1546d5

URL: https://github.com/llvm/llvm-project/commit/85b7b5625a009c738cec626cd5b02cd04d1546d5
DIFF: https://github.com/llvm/llvm-project/commit/85b7b5625a009c738cec626cd5b02cd04d1546d5.diff

LOG: Fix memory leak in 4318028cd2d7633a0cdeb0b5d4d2ed81fab87864

Added: 
    

Modified: 
    llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index fccf37c7e4e5..8a16b9f2fd0a 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -100,9 +100,9 @@ void DwarfCompileUnit::addLabelAddress(DIE &Die, dwarf::Attribute Attribute,
     addPoolOpAddress(*Loc, Label);
     addBlock(Die, Attribute, dwarf::DW_FORM_exprloc, Loc);
   } else
-    Die.addValue(
-        DIEValueAllocator, Attribute, dwarf::DW_FORM_LLVM_addrx_offset,
-        new DIEAddrOffset(DD->getAddressPool().getIndex(Base), Label, Base));
+    Die.addValue(DIEValueAllocator, Attribute, dwarf::DW_FORM_LLVM_addrx_offset,
+                 new (DIEValueAllocator) DIEAddrOffset(
+                     DD->getAddressPool().getIndex(Base), Label, Base));
 }
 
 void DwarfCompileUnit::addLocalLabelAddress(DIE &Die,


        


More information about the llvm-commits mailing list