Skip to content

Commit 03c6e4c

Browse files
authored
Add a test for cont.new of null (#125)
1 parent 74c1ef6 commit 03c6e4c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/core/stack-switching/cont.wast

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,17 @@
117117
(call $nl4 (cont.new $k1 (ref.func $r1)))
118118
)
119119

120-
(func (export "null")
120+
(func (export "null-resume")
121121
(resume $k1
122122
(ref.null $k1)
123123
)
124124
)
125+
126+
(func (export "null-new") (result (ref null $k1))
127+
(cont.new $k1
128+
(ref.null $f1)
129+
)
130+
)
125131
)
126132

127133
(assert_suspension (invoke "unhandled-1") "unhandled")
@@ -138,7 +144,8 @@
138144
(assert_trap (invoke "non-linear-3") "continuation already consumed")
139145
(assert_trap (invoke "non-linear-4") "continuation already consumed")
140146

141-
(assert_trap (invoke "null") "null continuation reference")
147+
(assert_trap (invoke "null-resume") "null continuation reference")
148+
(assert_trap (invoke "null-new") "null function reference")
142149

143150
(assert_invalid
144151
(module

0 commit comments

Comments
 (0)