mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-28 07:05:03 +00:00
DwarfDebug: Delete orphaned children.
Leak found by valgrind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189167 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5b83d0c092
commit
6bee6319c6
@ -639,7 +639,10 @@ DIE *DwarfDebug::constructScopeDIE(CompileUnit *TheCU, LexicalScope *Scope) {
|
||||
constructImportedEntityDIE(TheCU, i->second, ScopeDIE);
|
||||
}
|
||||
|
||||
if (!ScopeDIE) return NULL;
|
||||
if (!ScopeDIE) {
|
||||
std::for_each(Children.begin(), Children.end(), deleter<DIE>);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Add children
|
||||
for (SmallVectorImpl<DIE *>::iterator I = Children.begin(),
|
||||
|
Loading…
Reference in New Issue
Block a user