Skip to content

Commit 85b7b56

Browse files
committed
Fix memory leak in 4318028
1 parent 2c7cc5f commit 85b7b56

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ void DwarfCompileUnit::addLabelAddress(DIE &Die, dwarf::Attribute Attribute,
100100
addPoolOpAddress(*Loc, Label);
101101
addBlock(Die, Attribute, dwarf::DW_FORM_exprloc, Loc);
102102
} else
103-
Die.addValue(
104-
DIEValueAllocator, Attribute, dwarf::DW_FORM_LLVM_addrx_offset,
105-
new DIEAddrOffset(DD->getAddressPool().getIndex(Base), Label, Base));
103+
Die.addValue(DIEValueAllocator, Attribute, dwarf::DW_FORM_LLVM_addrx_offset,
104+
new (DIEValueAllocator) DIEAddrOffset(
105+
DD->getAddressPool().getIndex(Base), Label, Base));
106106
}
107107

108108
void DwarfCompileUnit::addLocalLabelAddress(DIE &Die,

0 commit comments

Comments
 (0)