Skip to content

Commit 5d03dba

Browse files
committed
Fixed PR review comment
1 parent b34c4be commit 5d03dba

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

interpreter/valid/valid.ml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ 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 (i < Lib.List32.length sts)
131-
132128
let check_num_type (c : context) (t : num_type) at =
133129
()
134130

@@ -143,8 +139,7 @@ let check_heap_type (c : context) (t : heap_type) at =
143139
| ExnHT | NoExnHT
144140
| ExternHT | NoExternHT -> ()
145141
| VarHT (StatX x) -> let _dt = type_ c (x @@ at) in ()
146-
| VarHT (RecX _) -> assert false
147-
| DefHT dt -> check_def_type c dt at
142+
| VarHT (RecX _) | DefHT _ -> assert false
148143
| BotHT -> ()
149144

150145
let check_ref_type (c : context) (t : ref_type) at =
@@ -185,7 +180,9 @@ let check_func_type (c : context) (ft : func_type) at =
185180

186181
let check_cont_type (c : context) (ct : cont_type) at =
187182
match ct with
188-
| ContT ht -> let _dt = func_type_of_heap_type c ht at in ()
183+
| ContT (VarHT (StatX x)) ->
184+
let _dt = func_type c (x @@ at) in ()
185+
| _ -> assert false
189186

190187
let check_table_type (c : context) (tt : table_type) at =
191188
let TableT (at_, lim, t) = tt in
@@ -208,7 +205,7 @@ let check_memory_type (c : context) (mt : memory_type) at =
208205

209206
let check_tag_type (c : context) (et : tag_type) at =
210207
match et with
211-
| TagT dt -> check_func_type c (as_func_str_type (expand_def_type dt)) at
208+
| TagT dt -> let _ft = as_func_str_type (expand_def_type dt) in ()
212209

213210
let check_global_type (c : context) (gt : global_type) at =
214211
let GlobalT (_mut, t) = gt in

0 commit comments

Comments
 (0)