Bug 1605282 - Don't call JS_IterateCompartments while inside GC finalization r=mccr8

This function doesn't expected to be called while running inside of the GC and asserts. At the moment this happens inside XPCJSRuntime::AssertInvalidWrappedJSNotInTable which is called while destroying a nsXPCWrappedJS. We should probably just skip the assertions in this case.

Differential Revision: https://phabricator.services.mozilla.com/D58525

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jon Coppeard 2020-01-02 15:55:04 +00:00
Родитель 3527413fa7
Коммит 6604449715
1 изменённых файлов: 1 добавлений и 1 удалений

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

@ -468,7 +468,7 @@ void XPCJSRuntime::AssertInvalidWrappedJSNotInTable(
#ifdef DEBUG
if (!wrapper->IsValid()) {
MOZ_ASSERT(!GetMultiCompartmentWrappedJSMap()->HasWrapper(wrapper));
if (!mGCIsRunning) {
if (!mGCIsRunning && !mDoingFinalization) {
JSContext* cx = XPCJSContext::Get()->Context();
JS_IterateCompartments(cx, wrapper, NotHasWrapperAssertionCallback);
}