Skip to content

Commit

Permalink
Resolve #17
Browse files Browse the repository at this point in the history
This patch (re)installs the check for continuation type
well-formedness.

Currently, it allows only continuation types to be indexed by plain
function types.
  • Loading branch information
dhil committed Jan 25, 2024
1 parent 4310c76 commit 0093476
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion interpreter/valid/valid.ml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ let check_func_type (c : context) (ft : func_type) at =

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

let check_table_type (c : context) (tt : table_type) at =
let TableT (lim, t) = tt in
Expand Down
5 changes: 5 additions & 0 deletions test/core/cont.wast
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@
(drop)))
"non-continuation type 0")

(assert_invalid
(module
(type $ct (cont $ct)))
"non-function type 0")

;; Simple state example

(module $state
Expand Down

0 comments on commit 0093476

Please sign in to comment.