Debian Codegraph @

js/src/jit-test/tests/wasm/gc/regress-1633355.js

raw
1 // |jit-test| skip-if: wasmCompileMode().includes("ion")
2
3 load(libdir + "asserts.js");
4
5 var g23 = newGlobal({newCompartment: true});
6 g23.parent = this;
7 g23.eval(`
8 var dbg = new Debugger(parent);
9 dbg.onEnterFrame = function(frame) {}
10 `);
11 let bin = wasmTextToBinary(`
12 (type $wabbit (struct
13 (field $x (mut i32))
14 (field $left (mut (ref null $wabbit)))
15 (field $right (mut (ref null $wabbit)))
16 ))
17 (global $g (mut (ref null $wabbit)) (ref.null $wabbit))
18 (func (export "init") (param $n i32)
19 (global.set $g (call $make (local.get $n)))
20 )
21 (func $make (param $n i32) (result (ref null $wabbit))
22 (local $tmp i32)
23 (struct.new $wabbit (local.get $tmp) (ref.null $wabbit) (ref.null $wabbit))
24 )
25 `);
26 let mod = new WebAssembly.Module(bin);
27 let ins = new WebAssembly.Instance(mod).exports;
28
29 // Debugger can handle non-exposable fields, like (ref T).
30 ins.init(6)