@@ -114,10 +114,6 @@ let func_type_of_tag_type (c : context) (TagT dt) at : func_type =
114
114
| DefFuncT ft -> ft
115
115
| _ -> error at " non-function type"
116
116
117
- let heap_type_of_str_type (_c : context ) (st : str_type ) : heap_type =
118
- DefHT (DefT (RecT [SubT (Final , [] , st)], Int32. of_int 0 ))
119
-
120
-
121
117
(* Types *)
122
118
123
119
let check_limits {min; max} range at msg =
@@ -600,9 +596,8 @@ let rec check_instr (c : context) (e : instr) (s : infer_result_type) : infer_in
600
596
(ts1 @ [NumT I32T ]) -->... [] , []
601
597
602
598
| ContNew x ->
603
- let ct = cont_type c x in
604
- let ft = func_type_of_cont_type c ct x.at in
605
- [RefT (Null , heap_type_of_str_type c (DefFuncT ft))] -->
599
+ let ContT ht = cont_type c x in
600
+ [RefT (Null , ht)] -->
606
601
[RefT (NoNull , DefHT (type_ c x))], []
607
602
608
603
| ContBind (x , y ) ->
@@ -615,8 +610,8 @@ let rec check_instr (c : context) (e : instr) (s : infer_result_type) : infer_in
615
610
let ts11, ts12 = Lib.List. split (List. length ts1 - List. length ts1') ts1 in
616
611
require (match_func_type c.types (FuncT (ts12, ts2)) ft') e.at
617
612
" type mismatch in continuation types" ;
618
- (ts11 @ [RefT (Null , heap_type_of_str_type c ( DefContT ct ))]) -->
619
- [RefT (NoNull , heap_type_of_str_type c ( DefContT ct' ))], []
613
+ (ts11 @ [RefT (Null , VarHT ( StatX x.it ))]) -->
614
+ [RefT (NoNull , VarHT ( StatX y.it ))], []
620
615
621
616
| Suspend x ->
622
617
let tag = tag c x in
@@ -627,15 +622,15 @@ let rec check_instr (c : context) (e : instr) (s : infer_result_type) : infer_in
627
622
let ct = cont_type c x in
628
623
let FuncT (ts1, ts2) = func_type_of_cont_type c ct x.at in
629
624
check_resume_table c ts2 xys e.at;
630
- (ts1 @ [RefT (Null , heap_type_of_str_type c ( DefContT ct ))]) --> ts2, []
625
+ (ts1 @ [RefT (Null , VarHT ( StatX x.it ))]) --> ts2, []
631
626
632
627
| ResumeThrow (x , y , xys ) ->
633
628
let ct = cont_type c x in
634
629
let FuncT (ts1, ts2) = func_type_of_cont_type c ct x.at in
635
630
let tag = tag c y in
636
631
let FuncT (ts0, _) = func_type_of_tag_type c tag y.at in
637
632
check_resume_table c ts2 xys e.at;
638
- (ts0 @ [RefT (Null , heap_type_of_str_type c ( DefContT ct ))]) --> ts2, []
633
+ (ts0 @ [RefT (Null , VarHT ( StatX x.it ))]) --> ts2, []
639
634
640
635
| Barrier (bt , es ) ->
641
636
let InstrT (ts1, ts2, xs) as ft = check_block_type c bt e.at in
0 commit comments