summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/tail-calls/bug1862473.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/wasm/tail-calls/bug1862473.js')
-rw-r--r--js/src/jit-test/tests/wasm/tail-calls/bug1862473.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/wasm/tail-calls/bug1862473.js b/js/src/jit-test/tests/wasm/tail-calls/bug1862473.js
new file mode 100644
index 0000000000..57e5ea2118
--- /dev/null
+++ b/js/src/jit-test/tests/wasm/tail-calls/bug1862473.js
@@ -0,0 +1,24 @@
+// |jit-test| --wasm-gc; 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/);