1344334 - Make DoTypeUpdateFallback infallible.
parent
32bc386753
commit
08f2c13914
|
@ -0,0 +1,14 @@
|
|||
if (!('oomTest' in this))
|
||||
quit();
|
||||
|
||||
function f(s) {
|
||||
s + "x";
|
||||
s.indexOf("y") === 0;
|
||||
oomTest(new Function(s));
|
||||
}
|
||||
var s = `
|
||||
class TestClass { constructor() {} }
|
||||
for (var fun of hasPrototype) {}
|
||||
`;
|
||||
if (s.length)
|
||||
f(s);
|
|
@ -323,7 +323,14 @@ DoTypeUpdateFallback(JSContext* cx, BaselineFrame* frame, ICUpdatedStub* stub, H
|
|||
MOZ_CRASH("Invalid stub");
|
||||
}
|
||||
|
||||
return stub->addUpdateStubForValue(cx, script /* = outerScript */, obj, id, value);
|
||||
if (!stub->addUpdateStubForValue(cx, script /* = outerScript */, obj, id, value)) {
|
||||
// The calling JIT code assumes this function is infallible (for
|
||||
// instance we may reallocate dynamic slots before calling this),
|
||||
// so ignore OOMs if we failed to attach a stub.
|
||||
cx->recoverFromOutOfMemory();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
typedef bool (*DoTypeUpdateFallbackFn)(JSContext*, BaselineFrame*, ICUpdatedStub*, HandleValue,
|
||||
|
|
Loading…
Reference in New Issue