Skip to content

Commit

Permalink
Fix catching in throw_ref (#299)
Browse files Browse the repository at this point in the history
The address `a` is a tag address, not an exception address.
  • Loading branch information
dschuff committed Mar 16, 2024
1 parent 25632dd commit 3dbe24e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions document/core/exec/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2803,13 +2803,13 @@ Control Instructions

a. Let :math:`\catch_1` be the first :ref:`catch clause <syntax-catch>` in :math:`\catch^\ast` and :math:`{\catch'}^\ast` the remaining clauses.

b. If :math:`\catch_1` is of the form :math:`\CATCH~x~l` and the :ref:`exception address <syntax-exnaddr>` :math:`a` equals :math:`F.\AMODULE.\MITAGS[x]`, then:
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:

i. Push the values :math:`\X{exn}.\EIFIELDS` to the stack.

ii. Execute the instruction :math:`\BR~l`.

c. Else if :math:`\catch_1` is of the form :math:`\CATCHREF~x~l` and the :ref:`exception address <syntax-exnaddr>` :math:`a` equals :math:`F.\AMODULE.\MITAGS[x]`, then:
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:

i. Push the values :math:`\X{exn}.\EIFIELDS` to the stack.

Expand Down

0 comments on commit 3dbe24e

Please sign in to comment.