blob: 7230332cb36e63da033a605bac5029f437119deb (
plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
(module
(type $ii (func (param i32 i32)))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
(import "env" "memory" (memory $0 256))
(import "env" "table" (table 0 funcref))
(import "env" "some-func-b" (func $some-func-b))
(import "env" "some-collide" (func $some-collide))
(data (global.get $memoryBase) "hello, B!\n")
(global $global-collide i32 (i32.const 0))
(global $global-collide-mut (mut i32) (i32.const 0))
(global $global-b i32 (i32.const 1))
(global $global-b-mut (mut i32) (i32.const 1))
(elem (global.get $tableBase) $only-b $willCollide $some-func-b $some-collide)
(export "exp-b" (func $only-b))
(export "exp-collide" (func $only-b))
(export "exp-collide2" (func $willCollide))
(export "exp-b-nameCollided" (func $willCollide))
(func $only-b
(drop (i32.const 111))
(call $only-b)
(call $some-func-b)
(call $some-collide)
(call_indirect (type $ii)
(i32.const 12)
(i32.const 34)
(i32.const 56)
)
(drop (global.get $global-collide))
(drop (global.get $global-b))
(drop (global.get $global-b-mut))
(drop (global.get $memoryBase))
(drop (global.get $tableBase))
(drop
(i32.add
(global.get $memoryBase)
(i32.const 1000)
)
)
(drop
(i32.add
(global.get $tableBase)
(i32.const 1000)
)
)
(drop
(i32.add
(global.get $tableBase)
(unreachable) ;; bad!
)
)
(drop
(i32.sub ;; bad!
(global.get $tableBase)
(i32.const 1000)
)
)
(global.set $global-collide-mut (i32.const 5678))
)
(func $willCollide
(drop (i32.const 222))
(call $willCollide)
)
)
|