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

Commit 0062d05

Browse files
authored
Formal overview: add uncaught exceptions (#221)
* Formal overview: add uncaught exceptions Based on this previous discussion: https://github.com/WebAssembly/exception-handling/pull/143/files#r761207853 Also: - fixed throw contexts to include situations where `val* T instr*` in general. * Addressed review comments.
1 parent ef312ac commit 0062d05

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

proposals/exception-handling/Exceptions-formal-overview.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,10 @@ Throw contexts don't skip over handlers (administrative `catch` or `delegate` in
138138
Throw contexts are used to match a thrown exception with the innermost handler.
139139

140140
```
141-
T ::= val* '[_]' instr* | 'label'_n{instr*} T 'end'
142-
| 'caught'{ tagaddr val^n } T 'end'
143-
| 'frame'_n{F} T end
141+
T ::= '[_]' | val* T instr*
142+
| 'label'_n{instr*} T 'end'
143+
| 'caught'{ tagaddr val* } T 'end'
144+
| 'frame'_n{F} T 'end'
144145
```
145146

146147
Note that because `catch` and `delegate` instructions are not included above, there is always a unique maximal throw context to match the reduction rules. Note that this basically means that `caught{..} instr* end` is not a potential catching block for exceptions thrown by `instr*`. The instruction sequence `instr*` is inside a `catch` or `catch_all` block.
@@ -221,6 +222,12 @@ S;C, labels (catch [t*]) ⊢ instr* : []→[t*]
221222
S;C, labels [t*] ⊢ caught{a val^*} instr* end : []→[t*]
222223
```
223224

224-
## TODO Uncaught Exceptions
225+
## Uncaught Exceptions
226+
227+
A new [result](https://webassembly.github.io/spec/core/exec/runtime.html#syntax-result) value is added to describe uncaught exceptions.
228+
229+
```
230+
result ::= val* | trap
231+
| T[val* (throw tagaddr)]
232+
```
225233

226-
We haven't yet described the formalism for an uncaught exception being the result of evaluation.

0 commit comments

Comments
 (0)