Skip to content

Commit 541abcb

Browse files
committed
[spec] Fix reduction rule for label (WebAssembly#1612)
Fix WebAssembly#1605.
1 parent f7ea587 commit 541abcb

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
@@ -2868,22 +2868,20 @@ Exiting :math:`\instr^\ast` with label :math:`L`
28682868

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

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

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

2875-
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`.
2875+
3. Pop the label from the stack.
28762876

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

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

28832881
.. math::
28842882
~\\[-1ex]
28852883
\begin{array}{lcl@{\qquad}l}
2886-
\LABEL_n\{\instr^\ast\}~\val^n~\END &\stepto& \val^n
2884+
\LABEL_n\{\instr^\ast\}~\val^\ast~\END &\stepto& \val^\ast
28872885
\end{array}
28882886
28892887
.. note::

0 commit comments

Comments
 (0)