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

add a little more complex case with a loop block #325

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
24 changes: 24 additions & 0 deletions test/core/try_table.wast
Original file line number Diff line number Diff line change
Expand Up @@ -376,3 +376,27 @@
)
"type mismatch"
)

(module
(tag $e (param i32))
(func $dec-and-throw (param i32)
local.get 0
i32.eqz
br_if 0
local.get 0
i32.const 1
i32.sub
throw $e
)
(func $loop (export "loop") (param i32)
local.get 0
loop (param i32)
try_table (param i32) (catch $e 0)
call $dec-and-throw
end
end
)
)

(assert_return (invoke "loop" (i32.const 0)))
(assert_return (invoke "loop" (i32.const 1000000)))
Loading