diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2010-03-22 18:47:14 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2010-03-22 18:47:14 +0000 |
commit | 54ebc986b150782fc96d6e5e36c14a0e0834087c (patch) | |
tree | 20e837594759b0482bd6fc1c9bb829b28fd7e0fd /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 760dc65d59a008ba1c080012b0103f4bff39e6cc (diff) | |
download | bcm5719-llvm-54ebc986b150782fc96d6e5e36c14a0e0834087c.tar.gz bcm5719-llvm-54ebc986b150782fc96d6e5e36c14a0e0834087c.zip |
Fix a memory leak from DIE::addSiblingOffset() by adding the DIEValue
it allocates to DwarfDebug::DIEValues.
llvm-svn: 99196
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 7153fe20dcf..c935d3a3312 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2351,7 +2351,8 @@ DwarfDebug::computeSizeAndOffset(DIE *Die, unsigned Offset, bool Last) { const std::vector<DIE *> &Children = Die->getChildren(); // If not last sibling and has children then add sibling offset attribute. - if (!Last && !Children.empty()) Die->addSiblingOffset(); + if (!Last && !Children.empty()) + DIEValues.push_back(Die->addSiblingOffset()); // Record the abbreviation. assignAbbrevNumber(Die->getAbbrev()); @@ -2465,7 +2466,7 @@ void DwarfDebug::emitDIE(DIE *Die) { dwarf::TagString(Abbrev->getTag())); EmitULEB128(AbbrevNumber); - SmallVector<DIEValue*, 32> &Values = Die->getValues(); + const SmallVector<DIEValue*, 32> &Values = Die->getValues(); const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev->getData(); // Emit the DIE attribute values. |