@@ -388,10 +388,10 @@ let rec step (c : config) : config =
388
388
| SuspendTo (x , y ), vs ->
389
389
let tagt = tag c.frame.inst y in
390
390
let FuncT (ts, _) = func_type_of_tag_type c.frame.inst (Tag. type_of tagt) in
391
- let args, vs' = i32_split (Lib.List32. length ts) vs e.at in
391
+ let args, vs' = i32_split (Int32. add ( Lib.List32. length ts) 1l ) vs e.at in
392
392
let args, href =
393
- match Lib.List. lead args, Lib.List. last args with
394
- | args , Ref r -> args , r
393
+ match args with
394
+ | Ref r :: rest -> rest , r
395
395
| _ -> Crash. error e.at " type mismatch at suspend to"
396
396
in
397
397
vs', [Suspending (tagt, args, None , Some href, fun code -> code) @@ e.at]
@@ -430,8 +430,7 @@ let rec step (c : config) : config =
430
430
431
431
| ResumeWith (x , xls ), Ref (ContRef ({contents = Some (n , ctxt )} as cont )) :: vs ->
432
432
let hs = handle_table c xls in
433
- Printf. printf " arity: %s\n %!" (I32. to_string_u n);
434
- let args, vs' = i32_split (I32. sub n 1l ) vs e.at in
433
+ let args, vs' = i32_split (Int32. sub n 1l ) vs e.at in
435
434
let exception Name in
436
435
let name =
437
436
Ref (HandlerRef (ref (Some Name )))
0 commit comments