Debian Codegraph @

rhino/testsrc/tests/js1_8/extensions/regress-415721.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 var gTestfile = 'regress-415721.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 415721;
9 var summary = 'jsatom.c double hashing re-validation logic is unsound';
10
11 printStatus (summary);
12
13 var VARS = 10000;
14 var TRIES = 100;
15
16 function atomizeStressTest() {
17 var fn = "function f() {var ";
18 for (var i = 0; i < VARS; i++)
19 fn += '_f' + i + ', ';
20 fn += 'q;}';
21
22 function e() { eval(fn); }
23
24 for (var i = 0; i < TRIES; i++) {
25 scatter([e,e]);
26 gc();
27 }
28 }
29
30 var expect;
31 var actual;
32
33 expect = actual = 'No crash';
34 if (typeof scatter == 'undefined' || typeof gc == 'undefined') {
35 print('Test skipped. scatter or gc not defined.');
36 expect = actual = 'Test skipped.';
37 } else {
38 atomizeStressTest();
39 }
40
41 reportCompare(expect, actual, summary);
42