summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/tail-calls/bug1862473.js
blob: fd44aa8f266638bcb8cf7923ec1595b077b5f1d1 (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
// |jit-test| --setpref=wasm_gc=true; skip-if: !wasmGcEnabled()

var ins = wasmEvalText(`(module
  (func $func1)
  (func $func2 (param i32 arrayref arrayref i32 i32 i32 i32)
    return_call $func1
  )
  (func (export "test")
    i32.const 1
    ref.null array
    ref.null array
    i32.const -2
    i32.const -3
    i32.const -4
    i32.const -5
    call $func2

    ref.null array
    ref.cast (ref array)
    drop
  )
)`);

assertErrorMessage(() => ins.exports.test(), WebAssembly.RuntimeError, /bad cast/);