File tree Expand file tree Collapse file tree
tests/regression/ba-issues/issues/issue-4646 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- ;; 定义不同的引用类型
1+ ;; define different reference types
22(type $struct_a (struct (field (mut i32 ))))
33(type $struct_b (struct (field (mut i64 ))))
44(type $struct_c (struct (field (mut i32 )) (field (mut i32 ))))
55
66(func $main
7- ;; 准备参数: i32, ref_a, i32, ref_b
7+ ;; prepare parameters: i32, ref_a, i32, ref_b
88 (i32.const 10 )
99 (struct.new $struct_a (i32.const 100 ))
1010 (i32.const 20 )
1111 (struct.new $struct_b (i64.const 200 ))
1212
13- ;; 带交错参数的block: i32, ref_a, i32, ref_b -> ref_c
13+ ;; block with interleaved parameters: i32, ref_a, i32, ref_b -> ref_c
1414 (block (param i32 (ref $struct_a ) i32 (ref $struct_b )) (result (ref $struct_c ))
15- ;; 清理栈中的参数
16- drop ;; 丢弃 ref_b
17- drop ;; 丢弃 i32
18- drop ;; 丢弃 ref_a
19- drop ;; 丢弃 i32
20- ;; 返回新的第三种类型引用
15+ ;; clean up parameters from stack
16+ drop ;; drop ref_b
17+ drop ;; drop i32
18+ drop ;; drop ref_a
19+ drop ;; drop i32
2120
21+ ;; return new type reference struct_c
2222 (struct.new $struct_c (i32.const 300 ) (i32.const 400 ))
2323 )
2424
25- ;; 丢弃返回值
25+ ;; drop return value
2626 drop
2727)
2828
You can’t perform that action at this time.
0 commit comments