bulk_table_init.wat (439B)
1 (module 2 (type $ret_i32 (func (result i32))) 3 (func $target (type $ret_i32) 4 i32.const 42) 5 (table 4 funcref) 6 ;; Passive element segment carrying one funcref. 7 (elem $eseg func $target) 8 (func (export "test_main") (result i32) 9 ;; table.init eseg: dst=2 src=0 len=1 10 i32.const 2 11 i32.const 0 12 i32.const 1 13 table.init $eseg 14 ;; Indirect call through table[2]. 15 i32.const 2 16 call_indirect (type $ret_i32)))