Skip to content

Commit 4a8ab35

Browse files
committed
really non-locality that can't be modelled by resume
1 parent 88c9f0a commit 4a8ab35

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
(module
2+
(type (;0;) (func (param i32)))
3+
(type (;1;) (func))
4+
(import "console" "log" (func (;0;) (type 0)))
5+
(func (;1;) (type 1)
6+
(local i32)
7+
try
8+
i32.const 1
9+
call 0
10+
call 2
11+
i32.const 3
12+
call 0
13+
catch
14+
;; [42, resume]
15+
i32.const 2
16+
call 0
17+
drop
18+
resume0
19+
i32.const 4
20+
call 0
21+
end
22+
i32.const 5
23+
call 0
24+
)
25+
(func (;2;) (type 1)
26+
call 3
27+
i32.const 3
28+
call 0
29+
)
30+
;; this time you really can't model with a `return`
31+
(func (;3;) (type 1)
32+
i32.const 42
33+
throw
34+
)
35+
(start 1))

src/test/scala/TestTFP.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ class TestTFP extends AnyFunSuite {
165165
testFileOutput("./benchmarks/wasm/trycatch/try_catch_call.wat", List(1, 2, 3, 3, 4, 5))
166166
}
167167

168+
test("try-catch-call-nested") {
169+
testFileOutput("./benchmarks/wasm/trycatch/try_catch_call_nested.wat", List(1, 2, 3, 3, 4, 5))
170+
}
171+
168172
// SpecTest
169173
test("spectest_return_call") {
170174
testWastFile("./benchmarks/wasm/spectest/return_call.bin.wast")

0 commit comments

Comments
 (0)