diff options
Diffstat (limited to 'js/src/jit-test/tests/wasm/regress/oom-wrong-argument-number-for-import-call.js')
-rw-r--r-- | js/src/jit-test/tests/wasm/regress/oom-wrong-argument-number-for-import-call.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/wasm/regress/oom-wrong-argument-number-for-import-call.js b/js/src/jit-test/tests/wasm/regress/oom-wrong-argument-number-for-import-call.js new file mode 100644 index 0000000000..2d41b466ea --- /dev/null +++ b/js/src/jit-test/tests/wasm/regress/oom-wrong-argument-number-for-import-call.js @@ -0,0 +1,24 @@ +// |jit-test| skip-if: !('oomTest' in this) + +function f() { + // Too many results returned. + return [52, 10, 0, 0]; +} + +let binary = wasmTextToBinary(` + (module + (import "env" "f" (func $f (result i32 i32 i32))) + (func (export "run") (result i32) + (call $f) + i32.sub + i32.sub)) +`); + +let module = new WebAssembly.Module(binary); +let instance = new WebAssembly.Instance(module, { env: { f } }); +let run = instance.exports.run; + +// Run once for setup. +try { run(); } catch {} + +oomTest(run); |