mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-03 09:14:30 +00:00
Fix a subtle use-after-free issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110863 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7f9ef4bb51
commit
cf6abd2486
@ -384,7 +384,6 @@ namespace {
|
||||
} // end anonymous namespace
|
||||
|
||||
void LazyValueInfoCache::LVIValueHandle::deleted() {
|
||||
Parent->ValueCache.erase(*this);
|
||||
for (std::set<std::pair<BasicBlock*, Value*> >::iterator
|
||||
I = Parent->OverDefinedCache.begin(),
|
||||
E = Parent->OverDefinedCache.end();
|
||||
@ -394,6 +393,10 @@ void LazyValueInfoCache::LVIValueHandle::deleted() {
|
||||
if (tmp->second == getValPtr())
|
||||
Parent->OverDefinedCache.erase(tmp);
|
||||
}
|
||||
|
||||
// This erasure deallocates *this, so it MUST happen after we're done
|
||||
// using any and all members of *this.
|
||||
Parent->ValueCache.erase(*this);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user