summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/bug1782468-ptrdiff-veclen.js
blob: 7d01e32f599a528d50f70a7b1cd375c54ee8c07a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// |jit-test| skip-if: getBuildConfiguration()["android"]

try {
  a = {};
  for (b = 0; b < 24; b++)
    a += a;
  Function(a, a, a);
  assertEq(true, false, "allocation overflow expected");
} catch (e) {
  if (getBuildConfiguration()['pointer-byte-size'] == 4) {
    assertEq((e + "").includes("InternalError: allocation size overflow"), true);
  } // else on 64-bit, it will be a SyntaxError for invalid code.
}