File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 148
148
(assert_return (invoke " call-7" ) (i32.const 65 ))
149
149
(assert_return (invoke " call-9" ) (i32.const 66 ))
150
150
151
+ ;; Same as the above, but use ref.null to ensure the elements use exprs.
152
+ ;; Note: some tools like wast2json avoid using exprs when possible.
153
+ (module
154
+ (type $out-i32 (func (result i32 )))
155
+ (table 11 funcref )
156
+ (elem (i32.const 6 ) funcref (ref.null func ) (ref.func $const-i32-a ))
157
+ (elem (i32.const 9 ) funcref (ref.func $const-i32-b ) (ref.null func ))
158
+ (func $const-i32-a (type $out-i32 ) (i32.const 65 ))
159
+ (func $const-i32-b (type $out-i32 ) (i32.const 66 ))
160
+ (func (export " call-7" ) (type $out-i32 )
161
+ (call_indirect (type $out-i32 ) (i32.const 7 ))
162
+ )
163
+ (func (export " call-9" ) (type $out-i32 )
164
+ (call_indirect (type $out-i32 ) (i32.const 9 ))
165
+ )
166
+ )
167
+ (assert_return (invoke " call-7" ) (i32.const 65 ))
168
+ (assert_return (invoke " call-9" ) (i32.const 66 ))
169
+
151
170
(assert_invalid
152
171
(module (table 1 funcref ) (global i32 (i32.const 0 )) (elem (global.get 0 ) $f ) (func $f ))
153
172
" unknown global"
You can’t perform that action at this time.
0 commit comments