Skip to content

Commit 6f44ca2

Browse files
committed
Fix return_call_indirect for multible tables
1 parent 269f18b commit 6f44ca2

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

document/core/appendix/index-instructions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def Instruction(name, opcode, type=None, validation=None, execution=None, operat
8888
Instruction(r'\CALL~x', r'\hex{10}', r'[t_1^\ast] \to [t_2^\ast]', r'valid-call', r'exec-call'),
8989
Instruction(r'\CALLINDIRECT~x~y', r'\hex{11}', r'[t_1^\ast~\I32] \to [t_2^\ast]', r'valid-call_indirect', r'exec-call_indirect'),
9090
Instruction(r'\RETURNCALL~x', r'\hex{12}', r'[t_1^\ast] \to [t_2^\ast]', r'valid-return_call', r'exec-return_call'),
91-
Instruction(r'\RETURNCALLINDIRECT~x', r'\hex{13}', r'[t_1^\ast~\I32] \to [t_2^\ast]', r'valid-return_call_indirect', r'exec-return_call_indirect'),
91+
Instruction(r'\RETURNCALLINDIRECT~x~y', r'\hex{13}', r'[t_1^\ast~\I32] \to [t_2^\ast]', r'valid-return_call_indirect', r'exec-return_call_indirect'),
9292
Instruction(None, r'\hex{14}'),
9393
Instruction(None, r'\hex{15}'),
9494
Instruction(None, r'\hex{16}'),

document/core/exec/instructions.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2854,22 +2854,22 @@ Control Instructions
28542854
28552855
.. _exec-return_call_indirect:
28562856

2857-
:math:`\RETURNCALLINDIRECT~x`
2858-
.............................
2857+
:math:`\RETURNCALLINDIRECT~x~y`
2858+
...............................
28592859

28602860
1. Let :math:`F` be the :ref:`current <exec-notation-textual>` :ref:`frame <syntax-frame>`.
28612861

2862-
2. Assert: due to :ref:`validation <valid-call_indirect>`, :math:`F.\AMODULE.\MITABLES[0]` exists.
2862+
2. Assert: due to :ref:`validation <valid-call_indirect>`, :math:`F.\AMODULE.\MITABLES[x]` exists.
28632863

2864-
3. Let :math:`\X{ta}` be the :ref:`table address <syntax-tableaddr>` :math:`F.\AMODULE.\MITABLES[0]`.
2864+
3. Let :math:`\X{ta}` be the :ref:`table address <syntax-tableaddr>` :math:`F.\AMODULE.\MITABLES[x]`.
28652865

28662866
4. Assert: due to :ref:`validation <valid-call_indirect>`, :math:`S.\STABLES[\X{ta}]` exists.
28672867

28682868
5. Let :math:`\X{tab}` be the :ref:`table instance <syntax-tableinst>` :math:`S.\STABLES[\X{ta}]`.
28692869

2870-
6. Assert: due to :ref:`validation <valid-call_indirect>`, :math:`F.\AMODULE.\MITYPES[x]` exists.
2870+
6. Assert: due to :ref:`validation <valid-call_indirect>`, :math:`F.\AMODULE.\MITYPES[y]` exists.
28712871

2872-
7. Let :math:`\X{ft}_{\F{expect}}` be the :ref:`function type <syntax-functype>` :math:`F.\AMODULE.\MITYPES[x]`.
2872+
7. Let :math:`\X{ft}_{\F{expect}}` be the :ref:`function type <syntax-functype>` :math:`F.\AMODULE.\MITYPES[y]`.
28732873

28742874
8. Assert: due to :ref:`validation <valid-call_indirect>`, a value with :ref:`value type <syntax-valtype>` |I32| is on the top of the stack.
28752875

@@ -2900,10 +2900,10 @@ Control Instructions
29002900

29012901
.. math::
29022902
\begin{array}{lcl@{\qquad}l}
2903-
\val~(\RETURNCALLINDIRECT~x) &\stepto& (\RETURNINVOKE~a)
2904-
& (\iff \val~(\CALLINDIRECT~x) \stepto (\INVOKE~a)) \\
2905-
\val~(\RETURNCALLINDIRECT~x) &\stepto& \TRAP
2906-
& (\iff \val~(\CALLINDIRECT~x) \stepto \TRAP) \\
2903+
\val~(\RETURNCALLINDIRECT~x~y) &\stepto& (\RETURNINVOKE~a)
2904+
& (\iff \val~(\CALLINDIRECT~x~y) \stepto (\INVOKE~a)) \\
2905+
\val~(\RETURNCALLINDIRECT~x~y) &\stepto& \TRAP
2906+
& (\iff \val~(\CALLINDIRECT~x~y) \stepto \TRAP) \\
29072907
\end{array}
29082908
29092909

0 commit comments

Comments
 (0)