Skip to content

Commit 0093476

Browse files
committed
Resolve WebAssembly#17
This patch (re)installs the check for continuation type well-formedness. Currently, it allows only continuation types to be indexed by plain function types.
1 parent 4310c76 commit 0093476

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

interpreter/valid/valid.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ let check_func_type (c : context) (ft : func_type) at =
183183

184184
let check_cont_type (c : context) (ct : cont_type) at =
185185
match ct with
186-
| ContT ft -> check_heap_type c ft at
186+
| ContT (VarHT (StatX x)) ->
187+
let _dt = func_type c (x @@ at) in ()
188+
| _ -> error at "ill-formed continuation type"
187189

188190
let check_table_type (c : context) (tt : table_type) at =
189191
let TableT (lim, t) = tt in

test/core/cont.wast

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@
205205
(drop)))
206206
"non-continuation type 0")
207207

208+
(assert_invalid
209+
(module
210+
(type $ct (cont $ct)))
211+
"non-function type 0")
212+
208213
;; Simple state example
209214

210215
(module $state

0 commit comments

Comments
 (0)