Debian Codegraph @

js/src/jit-test/tests/wasm/bug1776358.js

raw
1 let func = wasmEvalText(`(module
2 (func
3 (param f64) (param f64) (param f64) (param f64) (param f64)
4 (param f64) (param f64) (param f64) (param f64)
5 )
6 (func
7 (param i32)
8 (result i32)
9 ;; Call in a dead branch.
10 (if (i32.const 0) (then
11 (call 0
12 (f64.const 0) (f64.const 0) (f64.const 0) (f64.const 0) (f64.const 0)
13 (f64.const 0) (f64.const 0) (f64.const 0) (f64.const 0)
14 )
15 ))
16 ;; Division to trigger a trap.
17 (i32.div_s (local.get 0) (local.get 0))
18 )
19 (export "" (func 1))
20 )`).exports[""];
21 assertEq(func(7), 1);
22 let ex;
23 try {
24 func(0);
25 } catch (e) {
26 ex = e;
27 }
28 assertEq(ex instanceof WebAssembly.RuntimeError, true);