Skip to content

Commit 27ab27d

Browse files
authored
[spec] Fix reduction rule for label
Fix #1605.
1 parent 036365a commit 27ab27d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

document/core/exec/instructions.rst

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2860,22 +2860,20 @@ Exiting :math:`\instr^\ast` with label :math:`L`
28602860

28612861
When the end of a block is reached without a jump or trap aborting it, then the following steps are performed.
28622862

2863-
1. Let :math:`n` be the number of values on the top of the stack.
2863+
1. Pop all values :math:`\val^\ast` from the top of the stack.
28642864

2865-
2. Pop the values :math:`\val^n` from the stack.
2865+
2. Assert: due to :ref:`validation <valid-instr-seq>`, the label :math:`L` is now on the top of the stack.
28662866

2867-
3. Assert: due to :ref:`validation <valid-instr-seq>`, the label :math:`L` is now on the top of the stack and has arity :math:`n`.
2867+
3. Pop the label from the stack.
28682868

2869-
4. Pop the label from the stack.
2869+
4. Push :math:`\val^\ast` back to the stack.
28702870

2871-
5. Push :math:`\val^n` back to the stack.
2872-
2873-
6. Jump to the position after the |END| of the :ref:`structured control instruction <syntax-instr-control>` associated with the label :math:`L`.
2871+
5. Jump to the position after the |END| of the :ref:`structured control instruction <syntax-instr-control>` associated with the label :math:`L`.
28742872

28752873
.. math::
28762874
~\\[-1ex]
28772875
\begin{array}{lcl@{\qquad}l}
2878-
\LABEL_n\{\instr^\ast\}~\val^n~\END &\stepto& \val^n
2876+
\LABEL_n\{\instr^\ast\}~\val^\ast~\END &\stepto& \val^\ast
28792877
\end{array}
28802878
28812879
.. note::

0 commit comments

Comments
 (0)