зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1493627 part 3 - Use AutoEnterOOMUnsafeRegion in js::RemapWrapper. r=jonco
Depends on D9254 Differential Revision: https://phabricator.services.mozilla.com/D9255 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
1dbada33f5
Коммит
68af3a46d9
|
@ -0,0 +1,4 @@
|
|||
// |jit-test| skip-if: !('stackTest' in this)
|
||||
stackTest(function() {
|
||||
eval(`var g = newGlobal(); recomputeWrappers(this, g);`);
|
||||
});
|
|
@ -647,8 +647,9 @@ js::RemapWrapper(JSContext* cx, JSObject* wobjArg, JSObject* newTargetArg)
|
|||
// the choice to reuse |wobj| or not.
|
||||
RootedObject tobj(cx, newTarget);
|
||||
AutoRealmUnchecked ar(cx, wrealm);
|
||||
AutoEnterOOMUnsafeRegion oomUnsafe;
|
||||
if (!wcompartment->rewrap(cx, &tobj, wobj)) {
|
||||
MOZ_CRASH();
|
||||
oomUnsafe.crash("js::RemapWrapper");
|
||||
}
|
||||
|
||||
// If wrap() reused |wobj|, it will have overwritten it and returned with
|
||||
|
@ -670,7 +671,7 @@ js::RemapWrapper(JSContext* cx, JSObject* wobjArg, JSObject* newTargetArg)
|
|||
// wrapper, which has now been updated (via reuse or swap).
|
||||
MOZ_ASSERT(wobj->is<WrapperObject>());
|
||||
if (!wcompartment->putWrapper(cx, CrossCompartmentKey(newTarget), ObjectValue(*wobj))) {
|
||||
MOZ_CRASH();
|
||||
oomUnsafe.crash("js::RemapWrapper");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче