mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 698584 - Fix crash in RegExp.test in case of OOM. r=mrbkap
This commit is contained in:
parent
2deec91f21
commit
3ba6633987
@ -535,6 +535,8 @@ ExecuteRegExp(JSContext *cx, Native native, uintN argc, Value *vp)
|
|||||||
|
|
||||||
/* Step 3. */
|
/* Step 3. */
|
||||||
JSLinearString *linearInput = input->ensureLinear(cx);
|
JSLinearString *linearInput = input->ensureLinear(cx);
|
||||||
|
if (!linearInput)
|
||||||
|
return false;
|
||||||
const jschar *chars = linearInput->chars();
|
const jschar *chars = linearInput->chars();
|
||||||
size_t length = input->length();
|
size_t length = input->length();
|
||||||
|
|
||||||
|
13
js/src/jit-test/tests/basic/bug698584.js
Normal file
13
js/src/jit-test/tests/basic/bug698584.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* Any copyright is dedicated to the Public Domain.
|
||||||
|
* http://creativecommons.org/licenses/publicdomain/
|
||||||
|
*/
|
||||||
|
|
||||||
|
const MAX = 10000;
|
||||||
|
var str = "";
|
||||||
|
for (var i = 0; i < MAX; ++i) {
|
||||||
|
/x/.test(str);
|
||||||
|
str += str + 'xxxxxxxxxxxxxx';
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Don't crash */
|
Loading…
Reference in New Issue
Block a user