PageRenderTime 31ms CodeModel.GetById 20ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/js/src/jit-test/tests/jaeger/bug577705.js

http://github.com/zpao/v8monkey
JavaScript | 65 lines | 61 code | 2 blank | 2 comment | 6 complexity | d310164cc2a7ee112b433bcac29b836b MD5 | raw file
 1// |jit-test| error: ReferenceError
 2function f1() {
 3  N = 62;
 4  mt = Array
 5  function g1(n1) {
 6    return n1 < 0 ? (1 ^ 21) + 21: n1
 7  }
 8  function g2(n1, n2) {
 9    return g1(n1 + n2 & 4294967295);
10  }
11  function g3(n1, n2) {
12    sum = 0;
13    for (var i = 0; i < 32; ++i) {
14      if (n1 >> i) {
15        sum = g2(sum, g1(n2))
16      }
17    }
18    return sum
19  }
20  this.h1 = function() {
21    for (mti = 1; mti < N; mti++) {
22      mt[mti] = g2(g3(3, g1(mt[mti - 1] ^ 0)), mti)
23    }
24  };
25  this.i2 = function() {
26    if (mti > N) {
27      mti = 0;
28    }
29    y = mt[mti++];
30    return y
31  };
32  this.i1 = function() {
33    return (this.i2() + 5) * 2e-10
34  };
35} (function() {
36  fuzzMT = new f1;
37  fuzzMT.h1(9);
38  rnd = function(n) {
39    return Math.floor(fuzzMT.i1() * n)
40  };
41} ());
42function f5(a) {
43  return a[rnd(a.length)]
44}
45function f2(d, b) {
46  f3(d, b);
47  return "" + f2(2, b) + "";
48}
49function f3(d, b) {
50  if (rnd(4) == 1) {
51    f5(f4)(d, b)
52  }
53}
54var f4 = [function() { ["", f6(), ""]
55}];
56function f6(db) {
57  return f5(foo)();
58}
59var foo = [function() {
60  t(["", "", "", "", "", "", "", "", "", "", "", "" + h.I, ""]);
61}];
62f2()
63
64/* Don't assert or crash. */
65