mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 686274 - Increase the limit on the maximum size of array initializers (r=bhackett)
--HG-- extra : rebase_source : 1c2cb231b8f7ea58089b353654efc886ad244ad0
This commit is contained in:
parent
029347447b
commit
472ecf4674
@ -6220,7 +6220,7 @@ Parser<ParseHandler>::primaryExpr(TokenKind tt)
|
||||
bool spread = false, missingTrailingComma = false;
|
||||
unsigned index = 0;
|
||||
for (; ; index++) {
|
||||
if (index == StackSpace::ARGS_LENGTH_MAX) {
|
||||
if (index == JSObject::NELEMENTS_LIMIT) {
|
||||
report(ParseError, false, null(), JSMSG_ARRAY_INIT_TOO_BIG);
|
||||
return null();
|
||||
}
|
||||
|
11
js/src/jit-test/tests/basic/testBug686274.js
Normal file
11
js/src/jit-test/tests/basic/testBug686274.js
Normal file
@ -0,0 +1,11 @@
|
||||
function f(N) {
|
||||
var body = "return [";
|
||||
for (var i = 0; i < N-1; i++)
|
||||
body += "1,";
|
||||
body += "2]";
|
||||
var f = new Function(body);
|
||||
var arr = f();
|
||||
assertEq(arr.length, N);
|
||||
assertEq(arr[N-1], 2);
|
||||
}
|
||||
f(1000000);
|
Loading…
Reference in New Issue
Block a user