subtyping-depth.js (500B)
1 // |jit-test| include:wasm.js; include: wasm-binary.js; 2 3 // Limit of subtyping hierarchy 63 deep 4 function moduleSubtypingDepth(depth) { 5 let types = []; 6 types.push({final: false, kind: FuncCode, args: [], ret: []}); 7 for (let i = 1; i <= depth; i++) { 8 types.push({final: false, sub: i - 1, kind: FuncCode, args: [], ret: []}); 9 } 10 return moduleWithSections([typeSection(types)]); 11 } 12 wasmValidateBinary(moduleSubtypingDepth(63)); 13 wasmFailValidateBinary(moduleSubtypingDepth(64), /too deep/);