summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/regress/bug1866545.js
blob: 6c6a92c0abb1584cea9b6f5220d1e73bea67c1ae (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
// Tests stack alignment during tail calls (in Ion).

var ins = wasmEvalText(`
  (module
    (func $trap
        (param $i i32) (param $arr i32)
        unreachable
    )
    (func $second
      (return_call $trap
        (i32.const 33)
        (i32.const 66)
      )
    )
    (func (export "test")
        (call $second)
    )
  )
`);

assertErrorMessage(
    () => ins.exports.test(),
    WebAssembly.RuntimeError,
    "unreachable executed",
);