Bug 1425450 - Supress rooting analysis warning when removing a JS holder r=mccr8

Currently we get a rooting hazard when nsWrapperCache::UpdateWrapperForNewGlobal calls ReleaseWrapper because the analysis can't see through the virtual method call.

Differential Revision: https://phabricator.services.mozilla.com/D71600
This commit is contained in:
Jon Coppeard 2020-04-20 17:08:00 +00:00
Родитель ca427d70af
Коммит ec43abf814
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -1293,6 +1293,9 @@ struct ClearJSHolder : public TraceCallbacks {
void CycleCollectedJSRuntime::RemoveJSHolder(void* aHolder) {
nsScriptObjectTracer* tracer = mJSHolders.GetAndRemove(aHolder);
if (tracer) {
// Bug 1531951: The analysis can't see through the virtual call but we know
// that the ClearJSHolder tracer will never GC.
JS::AutoSuppressGCAnalysis nogc;
tracer->Trace(aHolder, ClearJSHolder(), nullptr);
}
}