summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/tail-calls/bug1891422.js
blob: c5c43d006f5cd34798ca71e6ebbd77caaba01680 (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
// |jit-test| --more-compartments; skip-variant-if: --setpref=wasm_test_serialization=true, true; skip-variant-if: --wasm-compiler=ion, true

a = newGlobal({ newCompartment: true });
a.b = this;
a.eval(`Debugger(b).onExceptionUnwind = function () {};`);

var ins0 = wasmEvalText(`(module
  (func $fac-acc (export "e") (param i64 i64)
    unreachable
  )
)`);
var ins = wasmEvalText(`(module
  (import "" "e" (func $fac-acc (param i64 i64)))
  (type $tz (func (param i64)))
  (table $t 1 1 funcref)
  (func $f (export "fac") (param i64)
    local.get 0
    i32.const 0
    return_call_indirect $t (type $tz)
  )
  (elem $t (i32.const 0) $fac-acc)
)`, {"": {e: ins0.exports.e}});


assertErrorMessage(() => {
  ins.exports.fac(5n);
}, WebAssembly.RuntimeError, /indirect call signature mismatch/);