1
// |reftest| skip -- slow
2
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
* License, v. 2.0. If a copy of the MPL was not distributed with this
5
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7
//-----------------------------------------------------------------------------
8
var BUGNUMBER = 345967;
9
var summary = 'Yet another unrooted atom in jsarray.c';
14
//-----------------------------------------------------------------------------
16
//-----------------------------------------------------------------------------
21
printBugNumber(BUGNUMBER);
22
printStatus (summary);
27
print('This test will probably run out of memory');
28
print('This test really should only fail on 64 bit machines');
30
var JSVAL_INT_MAX = (1 << 30) - 1;
32
var a = new Array(JSVAL_INT_MAX + 2);
34
a[JSVAL_INT_MAX + 1] = 1;
36
a.__defineGetter__(JSVAL_INT_MAX, function() { return 0; });
38
a.__defineSetter__(JSVAL_INT_MAX, function(value) {
39
delete a[JSVAL_INT_MAX + 1];
41
tmp[JSVAL_INT_MAX + 2] = 2;
43
if (typeof gc == 'function')
45
for (var i = 0; i != 50000; ++i) {
49
for (var i = 0; i != 1000; ++i) {
50
// Make string with 11 characters that would take
51
// (11 + 1) * 2 bytes or sizeof(JSAtom) so eventually
52
// malloc will ovewrite just freed atoms.
53
var tmp2 = Array(12).join(' ');
61
actual = a[JSVAL_INT_MAX];
62
if (expect !== actual)
65
reportCompare(expect, actual, summary);