File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,6 +125,10 @@ let check_limits {min; max} range at msg =
125125 require (I64. le_u min max) at
126126 " size minimum must not be greater than maximum"
127127
128+ let check_def_type (c : context ) (t : def_type ) at =
129+ match t with
130+ | DefT (RecT sts , i ) -> assert Int32. (compare i (of_int (List. length sts)) < 0 )
131+
128132let check_num_type (c : context ) (t : num_type ) at =
129133 ()
130134
@@ -139,7 +143,8 @@ let check_heap_type (c : context) (t : heap_type) at =
139143 | ExnHT | NoExnHT
140144 | ExternHT | NoExternHT -> ()
141145 | VarHT (StatX x ) -> let _dt = type_ c (x @@ at) in ()
142- | VarHT (RecX _ ) | DefHT _ -> assert false
146+ | VarHT (RecX _ ) -> assert false
147+ | DefHT dt -> check_def_type c dt at
143148 | BotHT -> ()
144149
145150let check_ref_type (c : context ) (t : ref_type ) at =
@@ -180,9 +185,7 @@ let check_func_type (c : context) (ft : func_type) at =
180185
181186let check_cont_type (c : context ) (ct : cont_type ) at =
182187 match ct with
183- | ContT (VarHT (StatX x )) ->
184- let _dt = func_type c (x @@ at) in ()
185- | _ -> assert false
188+ | ContT ht -> let _dt = func_type_of_heap_type c ht at in ()
186189
187190let check_table_type (c : context ) (tt : table_type ) at =
188191 let TableT (at_, lim, t) = tt in
You can’t perform that action at this time.
0 commit comments