mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-04 21:30:49 +00:00
Fix use after free when deleting attributes in a chained folding set.
Can't follow the intrusive linked list when the element is gone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165898 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2492a38afc
commit
fd8d62c0b4
@ -97,9 +97,11 @@ LLVMContextImpl::~LLVMContextImpl() {
|
||||
|
||||
// Destroy attributes.
|
||||
for (FoldingSetIterator<AttributesImpl> I = AttrsSet.begin(),
|
||||
E = AttrsSet.end(); I != E; ++I)
|
||||
delete &*I;
|
||||
|
||||
E = AttrsSet.end(); I != E;) {
|
||||
FoldingSetIterator<AttributesImpl> Elem = I++;
|
||||
delete &*Elem;
|
||||
}
|
||||
|
||||
// Destroy MDNodes. ~MDNode can move and remove nodes between the MDNodeSet
|
||||
// and the NonUniquedMDNodes sets, so copy the values out first.
|
||||
SmallVector<MDNode*, 8> MDNodes;
|
||||
|
Loading…
Reference in New Issue
Block a user