Bug 1417312 - Use copy instead of reference to avoid UAF in ASSERT. - r=daoshengmu

MozReview-Commit-ID: BWr9rkVhIHG
This commit is contained in:
Jeff Gilbert 2017-11-15 18:44:17 -08:00
parent c6f93a7aad
commit 257e273541

View File

@ -12,9 +12,9 @@ void
CacheMapInvalidator::InvalidateCaches() const
{
while (mCacheEntries.size()) {
const auto& entry = *(mCacheEntries.begin());
entry->Invalidate();
MOZ_ASSERT(mCacheEntries.find(entry) == mCacheEntries.end());
const auto pEntry = *(mCacheEntries.begin());
pEntry->Invalidate();
MOZ_ASSERT(mCacheEntries.find(pEntry) == mCacheEntries.end());
}
}