mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 16:28:38 +09:00
1344334 - Make DoTypeUpdateFallback infallible.
This commit is contained in:
parent
3c9c84e2ac
commit
61235c7be1
2 changed files with 22 additions and 1 deletions
14
js/src/jit-test/tests/baseline/bug1344334.js
Normal file
14
js/src/jit-test/tests/baseline/bug1344334.js
Normal file
|
|
@ -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…
Add table
Add a link
Reference in a new issue