Debian Codegraph @

js/src/jit-test/tests/wasm/regress/ion-many-results.js

raw
1 // This provokes a crash in ion if its tempalloc reservation logic is not
2 // up to snuff, bug 1675844.
3
4 for ( let i=100; i < 300; i++ ) {
5 let xs = new Array(i).fill(1);
6
7 // Should not crash the compiler but should fail validation
8 assertErrorMessage(() => new WebAssembly.Module(wasmTextToBinary(`
9 (module
10 (func $f (result ${xs.map(_ => 'i32 ').join(' ')})
11 ${xs.map((_) => '(i32.const 1)').join(' ')})
12 (func $g
13 (call $f)))`)),
14 WebAssembly.CompileError,
15 /(unused values not explicitly dropped)|(values remaining on stack)/);
16
17 }