diff options
Diffstat (limited to 'js/src/jit-test/tests/wasm/gc/limits/subtyping-depth.js')
-rw-r--r-- | js/src/jit-test/tests/wasm/gc/limits/subtyping-depth.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/wasm/gc/limits/subtyping-depth.js b/js/src/jit-test/tests/wasm/gc/limits/subtyping-depth.js new file mode 100644 index 0000000000..2d70215ee9 --- /dev/null +++ b/js/src/jit-test/tests/wasm/gc/limits/subtyping-depth.js @@ -0,0 +1,13 @@ +// |jit-test| --setpref=wasm_gc; include:wasm.js; include: wasm-binary.js; + +// Limit of subtyping hierarchy 63 deep +function moduleSubtypingDepth(depth) { + let types = []; + types.push({final: false, kind: FuncCode, args: [], ret: []}); + for (let i = 1; i <= depth; i++) { + types.push({final: false, sub: i - 1, kind: FuncCode, args: [], ret: []}); + } + return moduleWithSections([typeSection(types)]); +} +wasmValidateBinary(moduleSubtypingDepth(63)); +wasmFailValidateBinary(moduleSubtypingDepth(64), /too deep/); |