Skip to content

Commit 586ae27

Browse files
committed
Refactor implementation of ResumeThrowRef
and add some comments to tests.
1 parent 4d84e15 commit 586ae27

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

interpreter/exec/eval.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ let rec step (c : config) : config =
421421
v :: vs ->
422422
let hs = handle_table c xls in
423423
cont := None;
424-
vs, [Prompt (hs, ctxt ([v], [ThrowRef @@ e.at])) @@ e.at]
424+
vs, [Prompt (hs, ctxt ([v], [Plain ThrowRef @@ e.at])) @@ e.at]
425425

426426
| Switch (x, y), Ref (NullRef _) :: vs ->
427427
vs, [Trapping "null continuation reference" @@ e.at]

test/core/stack-switching/resume_throw.wast

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@
264264
(tag $exn (param i32))
265265
(func
266266
(i64.const 0)
267-
(resume_throw $ct $exn (ref.null $ct))
267+
(resume_throw $ct $exn (ref.null $ct)) ;; null continuation
268268
(unreachable)))
269269
"type mismatch")
270270

@@ -276,7 +276,7 @@
276276
(func
277277
(ref.null $ct)
278278
(i32.const 0)
279-
(resume_throw $ct $exn)
279+
(resume_throw $ct $exn) ;; exception tag does not take paramter
280280
(unreachable)))
281281
"type mismatch")
282282

@@ -286,7 +286,7 @@
286286
(type $ct (cont $ft))
287287
(tag $exn (param i32))
288288
(func
289-
(resume_throw $ct $exn (ref.null $ct))
289+
(resume_throw $ct $exn (ref.null $ct)) ;; missing exception payload
290290
(unreachable)))
291291
"type mismatch")
292292

@@ -298,7 +298,7 @@
298298
(tag $exn (param externref))
299299
(func
300300
(i64.const 0)
301-
(resume_throw_ref $ct (ref.null $ct))
301+
(resume_throw_ref $ct (ref.null $ct)) ;; expecting an exception ref
302302
(unreachable)))
303303
"type mismatch")
304304

@@ -307,6 +307,6 @@
307307
(type $ft (func))
308308
(type $ct (cont $ft))
309309
(func
310-
(resume_throw_ref $ct (ref.null $ct))
310+
(resume_throw_ref $ct (ref.null $ct)) ;; expecting an exception ref
311311
(unreachable)))
312312
"type mismatch")

0 commit comments

Comments
 (0)