summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/saved-stacks/oom-in-save-stack-02.js
blob: e62a3e953ed576f4fcf5ad3fae33a740321f5e8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// |jit-test| --no-ion; --no-baseline; --no-blinterp
// This shouldn't assert (bug 1516514).
//
// Disabled for ion and baseline because those introduce OOMs at some point that
// we don't seem to be able to catch, and they're not relevant to the bug.

let g = newGlobal();

function oomTest() {
  let done = false;
  for (let j = 1; !done; j++) {
    saveStack();

    oomAtAllocation(j);

    try {
      g.saveStack();
    } catch {}

    done = !resetOOMFailure();

    try {
      g.saveStack();
    } catch {}
  }
}

oomTest();