Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve #17 #18

Merged
merged 3 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ()
| _ -> assert false

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

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

(assert_invalid
(module
(rec
(type $s0 (struct (field (ref 0) (ref 1) (ref $s0) (ref $s1))))
(type $s1 (struct (field (ref 0) (ref 1) (ref $s0) (ref $s1))))
)
(type $ct (cont $s0)))
"non-function type 0")

(module
(rec
(type $f1 (func (param (ref $f2))))
(type $f2 (func (param (ref $f1))))
)
(type $c1 (cont $f1))
(type $c2 (cont $f2))
)

;; Simple state example

(module $state
Expand Down
Loading