Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit c7faca3

Browse files
committed
Describe when there's br within catch/unwind blocks
1 parent 263af13 commit c7faca3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

proposals/exception-handling/Exceptions.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ _default_ catch block. The default catch block has no exception type, and is
141141
used to catch all exceptions not caught by any of the tagged catch blocks. The
142142
term 'catch block' refers to both `catch` and `catch_all` blocks.
143143

144+
When the program runs `br` within `catch` or `catch_all` blocks, the rest of
145+
the catching blocks will not run and the program control will branch to the
146+
destination, as in normal blocks.
147+
144148
Try blocks, like control-flow blocks, have a _block type_. The block type of a
145149
try block defines the values yielded by evaluating the try block when either no
146150
exception is thrown, or the exception is successfully caught by the catch block.
@@ -168,6 +172,11 @@ block.
168172
The `end` instruction at the end of `unwind` block is special that it
169173
automatically rethrows the current exception.
170174

175+
When the program runs `br` within `unwind` block, the rest of the `unwind` block
176+
will not run and the program control will branch to the destination, as in
177+
normal blocks. Because we don't reach `end` of `unwind` block, rethrowing does
178+
not happen.
179+
171180
### Throwing an exception
172181

173182
The `throw` instruction takes an exception index as an immediate argument. That

0 commit comments

Comments
 (0)