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
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4068,75 +4068,75 @@ Control Instructions
4068
4068
:math:`\THROWREF`
4069
4069
.................
4070
4070
4071
-
1. Let :math:`F` be the :ref:`current <exec-notation-textual>` :ref:`frame <syntax-frame>`.
4072
-
4073
-
2. Assert: due to :ref:`validation <valid-throw_ref>`, a :ref:`reference <syntax-ref>` is on the top of the stack.
4071
+
1. Assert: due to :ref:`validation <valid-throw_ref>`, a :ref:`reference <syntax-ref>` is on the top of the stack.
4074
4072
4075
-
3. Pop the reference :math:`\reff` from the stack.
4073
+
2. Pop the reference :math:`\reff` from the stack.
4076
4074
4077
-
4. If :math:`\reff` is :math:`\REFNULL~\X{ht}`, then:
4075
+
3. If :math:`\reff` is :math:`\REFNULL~\X{ht}`, then:
4078
4076
4079
4077
a. Trap.
4080
4078
4081
-
5. Assert: due to :ref:`validation <valid-throw_ref>`, :math:`\reff` is an :ref:`exception reference <syntax-ref.exn>`.
4079
+
4. Assert: due to :ref:`validation <valid-throw_ref>`, :math:`\reff` is an :ref:`exception reference <syntax-ref.exn-addr>`.
4082
4080
4083
-
6. Let :math:`\REFEXNADDR~\X{ea}` be :math:`\reff`.
4081
+
5. Let :math:`\REFEXNADDR~\X{ea}` be :math:`\reff`.
4084
4082
4085
-
7. Assert: due to :ref:`validation <valid-throw_ref>`, :math:`S.\SEXNS[\X{ea}]` exists.
4083
+
6. Assert: due to :ref:`validation <valid-throw_ref>`, :math:`S.\SEXNS[\X{ea}]` exists.
4086
4084
4087
-
8. Let :math:`\X{exn}` be the :ref:`exception instance <syntax-exninst>` :math:`S.\SEXNS[\X{ea}]`.
4085
+
7. Let :math:`\X{exn}` be the :ref:`exception instance <syntax-exninst>` :math:`S.\SEXNS[\X{ea}]`.
4088
4086
4089
-
9. Let :math:`a` be the :ref:`tag address <syntax-tagaddr>` :math:`\X{exn}.\EITAG`.
4087
+
8. Let :math:`a` be the :ref:`tag address <syntax-tagaddr>` :math:`\X{exn}.\EITAG`.
4090
4088
4091
-
10. While the stack is not empty and the top of the stack is not an :ref:`exception handler <syntax-handler>`, do:
4089
+
9. While the stack is not empty and the top of the stack is not an :ref:`exception handler <syntax-handler>`, do:
4092
4090
4093
4091
a. Pop the top element from the stack.
4094
4092
4095
-
11. Assert: the stack is now either empty, or there is an exception handler on the top of the stack.
4093
+
10. Assert: the stack is now either empty, or there is an exception handler on the top of the stack.
4096
4094
4097
-
12. If the stack is empty, then:
4095
+
11. If the stack is empty, then:
4098
4096
4099
4097
a. Return the exception :math:`(\REFEXNADDR~a)` as a :ref:`result <syntax-result>`.
4100
4098
4101
-
13. Assert: there is an :ref:`exception handler <syntax-handler>` on the top of the stack.
4099
+
12. Assert: there is an :ref:`exception handler <syntax-handler>` on the top of the stack.
4102
4100
4103
-
14. Pop the exception handler :math:`\HANDLER_n\{\catch^\ast\}` from the stack.
4101
+
13. Pop the exception handler :math:`\HANDLER_n\{\catch^\ast\}` from the stack.
4104
4102
4105
-
15. If :math:`\catch^\ast` is empty, then:
4103
+
14. If :math:`\catch^\ast` is empty, then:
4106
4104
4107
4105
a. Push the exception reference :math:`\REFEXNADDR~\X{ea}` back to the stack.
4108
4106
4109
4107
b. Execute the instruction |THROWREF| again.
4110
4108
4111
-
16. Else:
4109
+
15. Else:
4112
4110
4113
-
a. Let :math:`\catch_1` be the first :ref:`catch clause <syntax-catch>` in :math:`\catch^\ast` and :math:`{\catch'}^\ast` the remaining clauses.
4111
+
a. Let :math:`F` be the :ref:`current <exec-notation-textual>` :ref:`frame <syntax-frame>`.
4114
4112
4115
-
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:
4113
+
b. Let :math:`\catch_1` be the first :ref:`catch clause <syntax-catch>` in :math:`\catch^\ast` and :math:`{\catch'}^\ast` the remaining clauses.
4114
+
4115
+
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:
4116
4116
4117
4117
i. Push the values :math:`\X{exn}.\EIFIELDS` to the stack.
4118
4118
4119
4119
ii. Execute the instruction :math:`\BR~l`.
4120
4120
4121
-
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:
4121
+
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:
4122
4122
4123
4123
i. Push the values :math:`\X{exn}.\EIFIELDS` to the stack.
4124
4124
4125
4125
ii. Push the exception reference :math:`\REFEXNADDR~\X{ea}` to the stack.
4126
4126
4127
4127
iii. Execute the instruction :math:`\BR~l`.
4128
4128
4129
-
d. Else if :math:`\catch_1` is of the form :math:`\CATCHALL~l`, then:
4129
+
e. Else if :math:`\catch_1` is of the form :math:`\CATCHALL~l`, then:
4130
4130
4131
4131
i. Execute the instruction :math:`\BR~l`.
4132
4132
4133
-
e. Else if :math:`\catch_1` is of the form :math:`\CATCHALLREF~l`, then:
4133
+
f. Else if :math:`\catch_1` is of the form :math:`\CATCHALLREF~l`, then:
4134
4134
4135
4135
i. Push the exception reference :math:`\REFEXNADDR~\X{ea}` to the stack.
4136
4136
4137
4137
ii. Execute the instruction :math:`\BR~l`.
4138
4138
4139
-
f. Else:
4139
+
g. Else:
4140
4140
4141
4141
1. Push the modified handler :math:`\HANDLER_n\{{\catch'}^\ast\}` back to the stack.
4142
4142
@@ -4737,9 +4737,9 @@ The following auxiliary rules define the semantics of entering and exiting |TRYT
4737
4737
Entering :math:`\instr^\ast` with label :math:`L` and exception handler :math:`H`
0 commit comments