Fix memory leak in 4318028cd2d7633a0cdeb0b5d4d2ed81fab87864
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 28 Jan 2021 20:07:31 +0000 (12:07 -0800)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 28 Jan 2021 20:08:23 +0000 (12:08 -0800)
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp

index fccf37c..8a16b9f 100644 (file)
@@ -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,