Skip to content

Commit d1bf45a

Browse files
committed
Fix exception allocation
1 parent 90cbd50 commit d1bf45a

File tree

3 files changed

+9
-35
lines changed

3 files changed

+9
-35
lines changed

document/core/exec/instructions.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4226,25 +4226,27 @@ Control Instructions
42264226

42274227
2. Assert: due to :ref:`validation <valid-throw>`, :math:`F.\AMODULE.\MITAGS[x]` exists.
42284228

4229-
3. Let :math:`ta` be the :ref:`tag address <syntax-tagaddr>` :math:`F.\AMODULE.\MITAGS[x]`.
4229+
3. Let :math:`\X{ta}` be the :ref:`tag address <syntax-tagaddr>` :math:`F.\AMODULE.\MITAGS[x]`.
42304230

4231-
4. Assert: due to :ref:`validation <valid-throw>`, :math:`S.\STAGS[ta]` exists.
4231+
4. Assert: due to :ref:`validation <valid-throw>`, :math:`S.\STAGS[\X{ta}]` exists.
42324232

4233-
5. Let :math:`\X{ti}` be the :ref:`tag instance <syntax-taginst>` :math:`S.\STAGS[ta]`.
4233+
5. Let :math:`\X{ti}` be the :ref:`tag instance <syntax-taginst>` :math:`S.\STAGS[\X{ta}]`.
42344234

42354235
6. Let :math:`[t^n] \toF [{t'}^\ast]` be the :ref:`tag type <syntax-tagtype>` :math:`\X{ti}.\TAGITYPE`.
42364236

42374237
7. Assert: due to :ref:`validation <valid-throw>`, there are at least :math:`n` values on the top of the stack.
42384238

42394239
8. Pop the :math:`n` values :math:`\val^n` from the stack.
42404240

4241-
9. Let :math:`\X{ea}` be the :ref:`exception address <syntax-exnaddr>` resulting from :ref:`allocating <alloc-exception>` an exception instance with tag address :math:`ta` and initializer values :math:`\val^n`.
4241+
9. Let :math:`\X{exn}` be the :ref:`exception instance <syntax-exninst>` :math:`\{\EITAG~\X{ta}, \EIFIELDS~\val^n\}`.
42424242

4243-
10. Let :math:`\X{exn}` be :math:`S.\SEXNS[ea]`
4243+
10. Let :math:`\X{ea}` be the length of :math:`S.\SEXNS`.
42444244

4245-
11. Push the value :math:`\REFEXNADDR~\X{ea}` to the stack.
4245+
11. Append :math:`\X{exn}` to :math:`S.\SEXNS`.
42464246

4247-
12. Execute the instruction |THROWREF|.
4247+
12. Push the value :math:`\REFEXNADDR~\X{ea}` to the stack.
4248+
4249+
13. Execute the instruction |THROWREF|.
42484250

42494251
.. math::
42504252
~\\[-1ex]

document/core/exec/modules.rst

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -170,32 +170,6 @@ are *allocated* in a :ref:`store <syntax-store>` :math:`S`, as defined by the fo
170170
\end{array}
171171
172172
173-
.. index:: exception, exception instance, exception address, tag address
174-
.. _alloc-exception:
175-
176-
:ref:`Exceptions <syntax-exninst>`
177-
..................................
178-
179-
1. Let :math:`ta` be the :ref:`tag address <syntax-tagaddr>` associated with the exception to allocate and :math:`\EIFIELDS~\val^\ast` be the values to initialize the exception with.
180-
181-
2. Let :math:`a` be the first free :ref:`exception address <syntax-exnaddr>` in :math:`S`.
182-
183-
3. Let :math:`\exninst` be the :ref:`exception instance <syntax-exninst>` :math:`\{ \EITAG~ta, \EIFIELDS~\val^\ast \}`.
184-
185-
4. Append :math:`\exninst` to the |SEXNS| of :math:`S`.
186-
187-
5. Return :math:`a`.
188-
189-
.. math::
190-
\begin{array}{rlll}
191-
\allocexn(S, \tagaddr, \val^\ast) &=& S', \exnaddr \\[1ex]
192-
\mbox{where:} \hfill \\
193-
\exnaddr &=& |S.\SEXNS| \\
194-
\exninst &=& \{ \EITAG~\tagaddr, \EIFIELDS~\val^\ast \} \\
195-
S' &=& S \compose \{\SEXNS~\exninst\} \\
196-
\end{array}
197-
198-
199173
.. index:: global, global instance, global address, global type, value type, mutability, value
200174
.. _alloc-global:
201175

document/core/util/macros.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,8 +1229,6 @@
12291229
.. |allocdata| mathdef:: \xref{exec/modules}{alloc-data}{\F{allocdata}}
12301230
.. |allocmodule| mathdef:: \xref{exec/modules}{alloc-module}{\F{allocmodule}}
12311231

1232-
.. |allocexn| mathdef:: \xref{exec/modules}{alloc-exception}{\F{allocexn}}
1233-
12341232
.. |growtable| mathdef:: \xref{exec/modules}{grow-table}{\F{growtable}}
12351233
.. |growmem| mathdef:: \xref{exec/modules}{grow-mem}{\F{growmem}}
12361234

0 commit comments

Comments
 (0)