This repository was archived by the owner on Apr 25, 2025. It is now read-only.
File tree 2 files changed +17
-7
lines changed
2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -202,12 +202,18 @@ let rec step (c : config) : config =
202
202
with Global. NotMutable -> Crash. error e.at " write to immutable global"
203
203
| Global. Type -> Crash. error e.at " type mismatch at global write" )
204
204
205
+ | TableCopy , I32 0l :: I32 s :: I32 d :: vs' ->
206
+ vs', []
207
+
205
208
(* TODO: turn into small-step, but needs reference values *)
206
209
| TableCopy , I32 n :: I32 s :: I32 d :: vs' ->
207
210
let tab = table frame.inst (0l @@ e.at) in
208
211
(try Table. copy tab d s n; vs', []
209
212
with exn -> vs', [Trapping (table_error e.at exn ) @@ e.at])
210
213
214
+ | TableInit x , I32 0l :: I32 s :: I32 d :: vs' ->
215
+ vs', []
216
+
211
217
(* TODO: turn into small-step, but needs reference values *)
212
218
| TableInit x , I32 n :: I32 s :: I32 d :: vs' ->
213
219
let tab = table frame.inst (0l @@ e.at) in
Original file line number Diff line number Diff line change 220
220
(elem $a (table 0 ) (i32.const 0 ) func $f )
221
221
222
222
(func (export " drop_passive" ) (elem.drop $p ))
223
- (func (export " init_passive" )
224
- (table.init $p (i32.const 0 ) (i32.const 0 ) (i32.const 0 )))
223
+ (func (export " init_passive" ) (param $len i32 )
224
+ (table.init $p (i32.const 0 ) (i32.const 0 ) (local.get $len ))
225
+ )
225
226
226
227
(func (export " drop_active" ) (elem.drop $a ))
227
- (func (export " init_active" )
228
- (table.init $a (i32.const 0 ) (i32.const 0 ) (i32.const 0 )))
228
+ (func (export " init_active" ) (param $len i32 )
229
+ (table.init $a (i32.const 0 ) (i32.const 0 ) (local.get $len ))
230
+ )
229
231
)
230
232
231
- (invoke " init_passive" )
233
+ (invoke " init_passive" ( i32.const 1 ) )
232
234
(invoke " drop_passive" )
233
235
(assert_trap (invoke " drop_passive" ) " element segment dropped" )
234
- (assert_trap (invoke " init_passive" ) " element segment dropped" )
236
+ (assert_return (invoke " init_passive" (i32.const 0 )))
237
+ (assert_trap (invoke " init_passive" (i32.const 1 )) " element segment dropped" )
235
238
(assert_trap (invoke " drop_active" ) " element segment dropped" )
236
- (assert_trap (invoke " init_active" ) " element segment dropped" )
239
+ (assert_return (invoke " init_active" (i32.const 0 )))
240
+ (assert_trap (invoke " init_active" (i32.const 1 )) " element segment dropped" )
237
241
238
242
239
243
;; table.copy
You can’t perform that action at this time.
0 commit comments