1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
(module
(func $leak (result i32)
(block
(i64.const 7)
(i32.const 1)
(br_if 0)
(unreachable)
)
(i32.const 0)
)
(func (export "run") (param i32) (result i32)
(local i32)
(local.get 0)
(local.set 1)
(block
(loop
(local.get 1)
(i32.eqz)
(br_if 1)
(call $leak)
(drop)
(local.get 1)
(i32.const 1)
(i32.sub)
(local.set 1)
(br 0)
)
)
(i32.const 0)
)
)
(assert_return (invoke "run" (i32.const 40000)) (i32.const 0))