You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apply suggestions from code review and email communication.
In particular:
- Switched to
handler ::= (tagaddr? instr*)* | labelidx
exn ::= tagaddr val*
instr ::= … | handler_n{handler} instr* end | caught_n{exn} instr* end
removing DELEGATEadm
- Changed prose to just push and pop handlers and exceptions, in the runtime,
in the execution steps of the instructions, in the formal overview,
and partly in appendix/properties.
Not done:
- Did not change the notation and prose for CAUGHTadm
in appendix/properties.rst, this will be done in PR WebAssembly#244.
* Let :math:`C'` be the same :ref:`context <context>` as :math:`C`, but with the :ref:`label type <syntax-labeltype>` :math:`[t_2^\ast]` prepended to the |CLABELS| vector.
615
615
616
616
* Under context :math:`C'`,
617
-
the instruction sequence :math:`\instr_2^\ast` must be :ref:`valid <valid-instr-seq>` with type :math:`[] \to [t_2^\ast]`.
617
+
the instruction sequence :math:`\instr_2^\ast` must be :ref:`valid <valid-instr-seq>` with type :math:`[] \to [t_2^n]`.
618
618
619
-
* Let :math:`C''` be the same :ref:`context <context>` as :math:`C`, but with the :ref:`label type <syntax-labeltype>` :math:`(\LCATCH~[t_2^\ast])` prepended to the |CLABELS| vector.
619
+
* Let :math:`C''` be the same :ref:`context <context>` as :math:`C`, but with the :ref:`label type <syntax-labeltype>` :math:`(\LCATCH~[t_2^n])` prepended to the |CLABELS| vector.
620
620
621
621
* Under context :math:`C''`,
622
622
for every :math:`\tagaddr^?` and associated instruction sequence :math:`\instr_1^\ast`:
623
623
624
-
* If :math:`\tagaddr^? = \epsilon`, then :math:`\instr_1^\ast` must be :ref:`valid <valid-instr-seq>` with type :math:`[] \to [t_2^\ast]`.
624
+
* If :math:`\tagaddr^? = \epsilon`, then :math:`\instr_1^\ast` must be :ref:`valid <valid-instr-seq>` with type :math:`[] \to [t_2^n]`.
625
625
626
626
* Else:
627
627
628
628
* The :ref:`external tag value <syntax-externval>` :math:`\EVTAG~\tagaddr` must be :ref:`valid <valid-externval-tag>` with some :ref:`external tag type <syntax-externtype>` :math:`\ETTAG~[t_1^\ast] \to []`.
629
629
630
-
* The instruction sequence :math:`\instr_1^\ast` must be :ref:`valid <valid-instr-seq>` with type :math:`[t_1^\ast] \to [t_2^\ast]`.
630
+
* The instruction sequence :math:`\instr_1^\ast` must be :ref:`valid <valid-instr-seq>` with type :math:`[t_1^\ast] \to [t_2^n]`.
631
631
632
-
* Then the compound instruction is valid under context :math:`C'` with type :math:`[] \to [t_2^\ast]`.
632
+
* Then the compound instruction is valid under context :math:`C'` with type :math:`[] \to [t_2^n]`.
Copy file name to clipboardExpand all lines: document/core/exec/instructions.rst
+60-77Lines changed: 60 additions & 77 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2643,26 +2643,26 @@ Control Instructions
2643
2643
2644
2644
b. Let :math:`a_i` be the tag address :math:`F.\AMODULE.\MITAGS[x_i]`.
2645
2645
2646
-
c. Let :math:`H_i` be the handler clause :math:`\{a_i~\instr_{2i}^\ast\}`.
2646
+
c. Let :math:`H_i` be the handler :math:`(a_i~\instr_{2i}^\ast)`.
2647
2647
2648
2648
8. If there is a catch all clause :math:`(\CATCHALL~\instr_3^\ast)`, then:
2649
2649
2650
-
a. Let :math:`H'^?` be the handler clause :math:`\{\epsilon~\instr_3^\ast\}`.
2650
+
a. Let :math:`H'^?` be the handler :math:`(\epsilon~\instr_3^\ast)`.
2651
2651
2652
2652
9. Else:
2653
2653
2654
-
a. Let :math:`H'^?` be the empty handler clause :math:`\epsilon`.
2654
+
a. Let :math:`H'^?` be the empty handler :math:`\epsilon`.
2655
2655
2656
-
10. Let :math:`H^\ast` be the :ref:`catching exception handler <syntax-handler>` containing the concatenation of the handler clauses:math:`H_i` and :math:`H'^?`.
2656
+
10. Let :math:`H^\ast` be the concatenation of :math:`H_i` and :math:`H'^?`.
2657
2657
2658
-
11. :ref:`Enter <exec-handler-enter>` the block :math:`\val^m~\instr_1^\ast` with label :math:`L` and exception handler :math:`H`.
2658
+
11. :ref:`Enter <exec-handler-enter>` the block :math:`\val^m~\instr_1^\ast` with label :math:`L` and exception handler :math:`H^\ast`.
An exception can only be rethrown from the scope of the |CAUGHTadm| administrative instruction holding it, i.e., from the scope of the |CATCH| or |CATCHALL| block of a :ref:`try-catch <syntax-try-catch>` instruction that caught it. Upon exit from a |CAUGHTadm|, the exception it holds is discarded.
3184
+
A caught exception can only be rethrown from the scope of the administrative instruction associated with it, i.e., from the scope of the |CATCH| or |CATCHALL| block of a :ref:`try-catch <syntax-try-catch>` instruction that caught it. Upon exit from that block, the caught exception is discarded.
3202
3185
3203
3186
3204
3187
.. index:: ! call, function, function instance, label, frame
0 commit comments