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
Copy file name to clipboardExpand all lines: document/core/exec/instructions.rst
+23-23
Original file line number
Diff line number
Diff line change
@@ -2757,75 +2757,75 @@ Control Instructions
2757
2757
:math:`\THROWREF`
2758
2758
.................
2759
2759
2760
-
1. Let :math:`F` be the :ref:`current <exec-notation-textual>` :ref:`frame <syntax-frame>`.
2761
-
2762
-
2. Assert: due to :ref:`validation <valid-throw_ref>`, a :ref:`reference <syntax-ref>` is on the top of the stack.
2760
+
1. Assert: due to :ref:`validation <valid-throw_ref>`, a :ref:`reference <syntax-ref>` is on the top of the stack.
2763
2761
2764
-
3. Pop the reference :math:`\reff` from the stack.
2762
+
2. Pop the reference :math:`\reff` from the stack.
2765
2763
2766
-
4. If :math:`\reff` is :math:`\REFNULL~\X{ht}`, then:
2764
+
3. If :math:`\reff` is :math:`\REFNULL~\X{ht}`, then:
2767
2765
2768
2766
a. Trap.
2769
2767
2770
-
5. Assert: due to :ref:`validation <valid-throw_ref>`, :math:`\reff` is an :ref:`exception reference <syntax-ref.exn-addr>`.
2768
+
4. Assert: due to :ref:`validation <valid-throw_ref>`, :math:`\reff` is an :ref:`exception reference <syntax-ref.exn-addr>`.
2771
2769
2772
-
6. Let :math:`\REFEXNADDR~\X{ea}` be :math:`\reff`.
2770
+
5. Let :math:`\REFEXNADDR~\X{ea}` be :math:`\reff`.
2773
2771
2774
-
7. Assert: due to :ref:`validation <valid-throw_ref>`, :math:`S.\SEXNS[\X{ea}]` exists.
2772
+
6. Assert: due to :ref:`validation <valid-throw_ref>`, :math:`S.\SEXNS[\X{ea}]` exists.
2775
2773
2776
-
8. Let :math:`\X{exn}` be the :ref:`exception instance <syntax-exninst>` :math:`S.\SEXNS[\X{ea}]`.
2774
+
7. Let :math:`\X{exn}` be the :ref:`exception instance <syntax-exninst>` :math:`S.\SEXNS[\X{ea}]`.
2777
2775
2778
-
9. Let :math:`a` be the :ref:`tag address <syntax-tagaddr>` :math:`\X{exn}.\EITAG`.
2776
+
8. Let :math:`a` be the :ref:`tag address <syntax-tagaddr>` :math:`\X{exn}.\EITAG`.
2779
2777
2780
-
10. While the stack is not empty and the top of the stack is not an :ref:`exception handler <syntax-handler>`, do:
2778
+
9. While the stack is not empty and the top of the stack is not an :ref:`exception handler <syntax-handler>`, do:
2781
2779
2782
2780
a. Pop the top element from the stack.
2783
2781
2784
-
11. Assert: the stack is now either empty, or there is an exception handler on the top of the stack.
2782
+
10. Assert: the stack is now either empty, or there is an exception handler on the top of the stack.
2785
2783
2786
-
12. If the stack is empty, then:
2784
+
11. If the stack is empty, then:
2787
2785
2788
2786
a. Return the exception :math:`(\REFEXNADDR~a)` as a :ref:`result <syntax-result>`.
2789
2787
2790
-
13. Assert: there is an :ref:`exception handler <syntax-handler>` on the top of the stack.
2788
+
12. Assert: there is an :ref:`exception handler <syntax-handler>` on the top of the stack.
2791
2789
2792
-
14. Pop the exception handler :math:`\HANDLER_n\{\catch^\ast\}` from the stack.
2790
+
13. Pop the exception handler :math:`\HANDLER_n\{\catch^\ast\}` from the stack.
2793
2791
2794
-
15. If :math:`\catch^\ast` is empty, then:
2792
+
14. If :math:`\catch^\ast` is empty, then:
2795
2793
2796
2794
a. Push the exception reference :math:`\REFEXNADDR~\X{ea}` back to the stack.
2797
2795
2798
2796
b. Execute the instruction |THROWREF| again.
2799
2797
2800
-
16. Else:
2798
+
15. Else:
2799
+
2800
+
a. Let :math:`F` be the :ref:`current <exec-notation-textual>` :ref:`frame <syntax-frame>`.
2801
2801
2802
-
a. Let :math:`\catch_1` be the first :ref:`catch clause <syntax-catch>` in :math:`\catch^\ast` and :math:`{\catch'}^\ast` the remaining clauses.
2802
+
b. Let :math:`\catch_1` be the first :ref:`catch clause <syntax-catch>` in :math:`\catch^\ast` and :math:`{\catch'}^\ast` the remaining clauses.
2803
2803
2804
-
b. If :math:`\catch_1` is of the form :math:`\CATCH~x~l` and the :ref:`tag address <syntax-tagaddr>` :math:`a` equals :math:`F.\AMODULE.\MITAGS[x]`, then:
2804
+
c. If :math:`\catch_1` is of the form :math:`\CATCH~x~l` and the :ref:`tag address <syntax-tagaddr>` :math:`a` equals :math:`F.\AMODULE.\MITAGS[x]`, then:
2805
2805
2806
2806
i. Push the values :math:`\X{exn}.\EIFIELDS` to the stack.
2807
2807
2808
2808
ii. Execute the instruction :math:`\BR~l`.
2809
2809
2810
-
c. Else if :math:`\catch_1` is of the form :math:`\CATCHREF~x~l` and the :ref:`tag address <syntax-tagaddr>` :math:`a` equals :math:`F.\AMODULE.\MITAGS[x]`, then:
2810
+
d. Else if :math:`\catch_1` is of the form :math:`\CATCHREF~x~l` and the :ref:`tag address <syntax-tagaddr>` :math:`a` equals :math:`F.\AMODULE.\MITAGS[x]`, then:
2811
2811
2812
2812
i. Push the values :math:`\X{exn}.\EIFIELDS` to the stack.
2813
2813
2814
2814
ii. Push the exception reference :math:`\REFEXNADDR~\X{ea}` to the stack.
2815
2815
2816
2816
iii. Execute the instruction :math:`\BR~l`.
2817
2817
2818
-
d. Else if :math:`\catch_1` is of the form :math:`\CATCHALL~l`, then:
2818
+
e. Else if :math:`\catch_1` is of the form :math:`\CATCHALL~l`, then:
2819
2819
2820
2820
i. Execute the instruction :math:`\BR~l`.
2821
2821
2822
-
e. Else if :math:`\catch_1` is of the form :math:`\CATCHALLREF~l`, then:
2822
+
f. Else if :math:`\catch_1` is of the form :math:`\CATCHALLREF~l`, then:
2823
2823
2824
2824
i. Push the exception reference :math:`\REFEXNADDR~\X{ea}` to the stack.
2825
2825
2826
2826
ii. Execute the instruction :math:`\BR~l`.
2827
2827
2828
-
f. Else:
2828
+
g. Else:
2829
2829
2830
2830
1. Push the modified handler :math:`\HANDLER_n\{{\catch'}^\ast\}` back to the stack.
0 commit comments