mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1208994 - ToAtom<NoGC> should not throw an exception on failure r=terrence
This commit is contained in:
parent
7c10dfa088
commit
a68d8c7152
4
js/src/jit-test/tests/gc/bug-1208994.js
Normal file
4
js/src/jit-test/tests/gc/bug-1208994.js
Normal file
@ -0,0 +1,4 @@
|
||||
// |jit-test| --no-threads
|
||||
|
||||
load(libdir + 'oomTest.js');
|
||||
oomTest(() => getBacktrace({args: oomTest[load+1], locals: true, thisprops: true}));
|
@ -498,7 +498,12 @@ js::ToAtom(ExclusiveContext* cx, typename MaybeRooted<Value, allowGC>::HandleTyp
|
||||
if (str->isAtom())
|
||||
return &str->asAtom();
|
||||
|
||||
return AtomizeString(cx, str);
|
||||
JSAtom* atom = AtomizeString(cx, str);
|
||||
if (!atom && !allowGC) {
|
||||
MOZ_ASSERT_IF(cx->isJSContext(), cx->asJSContext()->isThrowingOutOfMemory());
|
||||
cx->recoverFromOutOfMemory();
|
||||
}
|
||||
return atom;
|
||||
}
|
||||
|
||||
template JSAtom*
|
||||
|
Loading…
Reference in New Issue
Block a user