Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit c3289d2

Browse files
authored
[spec] Add element type to passive element segment (#90)
This was accidentally omitted.
1 parent eca021a commit c3289d2

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

document/core/binary/modules.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ It decodes into a vector of :ref:`element segments <syntax-elem>` that represent
329329
\production{element segment} & \Belem &::=&
330330
\hex{00}~~e{:}\Bexpr~~y^\ast{:}\Bvec(\Bfuncidx)
331331
&\Rightarrow& \{ \ETABLE~0, \EOFFSET~e, \EINIT~((\REFFUNC~y)~\END)^\ast \} \\ &&|&
332-
\hex{01}~~e^\ast{:}\Bvec(\Belemexpr)
333-
&\Rightarrow& \{ \EINIT~e^\ast \} \\ &&|&
332+
\hex{01}~~\X{et}:\Belemtype~e^\ast{:}\Bvec(\Belemexpr)
333+
&\Rightarrow& \{ \ETYPE~et, \EINIT~e^\ast \} \\ &&|&
334334
\hex{02}~~x{:}\Btableidx~~e{:}\Bexpr~~y^\ast{:}\Bvec(\Bfuncidx)
335335
&\Rightarrow& \{ \ETABLE~x, \EOFFSET~e, \EINIT~((\REFFUNC~y)~\END)^\ast \} \\
336336
\production{elemexpr} & \Belemexpr &::=&

document/core/syntax/modules.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,13 @@ The initial contents of a table is uninitialized. *Element segments* can be used
256256

257257
Element segments can be :ref:`active <syntax-active>` or :ref:`passive <syntax-passive>`. An active element segment copies its elements into a table during :ref:`instantiation <exec-instantiation>`. A passive element segment's elements can be copied using the |TABLEINIT| instruction.
258258

259-
The |MELEM| component of a module defines a vector of element segments. Each active element segment defines the |ETABLE| and the starting |EOFFSET| in that table to initialize. Each passive element segment only defines its contents.
259+
The |MELEM| component of a module defines a vector of element segments. Each active element segment defines the |ETABLE| and the starting |EOFFSET| in that table to initialize. Each passive element segment defines its element type and contents.
260260

261261
.. math::
262262
\begin{array}{llll}
263263
\production{element segment} & \elem &::=&
264264
\{ \ETABLE~\tableidx, \EOFFSET~\expr, \EINIT~\vec(\elemexpr) \} \\&&|&
265-
\{ \EINIT~\vec(\elemexpr) \} \\
265+
\{ \ETYPE~\elemtype, \EINIT~\vec(\elemexpr) \} \\
266266
\production{elemexpr} & \elemexpr &::=&
267267
\REFNULL~\END \\&&|&
268268
(\REFFUNC~\funcidx)~\END \\

document/core/text/modules.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,8 @@ Element segments allow for an optional :ref:`table index <text-tableidx>` to ide
485485
\production{element segment} & \Telem_I &::=&
486486
\text{(}~\text{elem}~~\Tid^?~~x{:}\Ttableidx_I~~\text{(}~\text{offset}~~e{:}\Texpr_I~\text{)}~~y^\ast{:}\Tvec(\Tfuncidx_I)~\text{)} \\ &&& \qquad
487487
\Rightarrow\quad \{ \ETABLE~x, \EOFFSET~e, \EINIT~y^\ast \} \\ &&|&
488-
\text{(}~\text{elem}~~\Tid^?~~\text{passive}~~y^\ast{:}\Tvec(\Tfuncidx_I)~\text{)} \\ &&& \qquad
489-
\Rightarrow\quad \{ \EINIT~y^\ast \} \\
488+
\text{(}~\text{elem}~~\Tid^?~~et{:}\Telemtype~~y^\ast{:}\Tvec(\Tfuncidx_I)~\text{)} \\ &&& \qquad
489+
\Rightarrow\quad \{ \ETYPE~et, \EINIT~y^\ast \} \\
490490
\end{array}
491491
492492
.. note::

document/core/util/macros.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@
266266
.. |ETABLE| mathdef:: \xref{syntax/modules}{syntax-elem}{\K{table}}
267267
.. |EOFFSET| mathdef:: \xref{syntax/modules}{syntax-elem}{\K{offset}}
268268
.. |EINIT| mathdef:: \xref{syntax/modules}{syntax-elem}{\K{init}}
269+
.. |ETYPE| mathdef:: \xref{syntax/modules}{syntax-elem}{\K{type}}
269270

270271
.. |REFNULL| mathdef:: \xref{syntax/modules}{syntax-elemexpr}{\K{ref.null}}
271272
.. |REFFUNC| mathdef:: \xref{syntax/modules}{syntax-elemexpr}{\K{ref.func}}

document/core/valid/modules.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Element segments :math:`\elem` are classified by :ref:`segment types <syntax-seg
181181
}
182182
183183
184-
:math:`\{ \EINIT~e^\ast \}`
184+
:math:`\{ \ETYPE~et, \EINIT~e^\ast \}`
185185
...........................
186186

187187
* For each :math:`e_i` in :math:`e^\ast`,
@@ -195,7 +195,7 @@ Element segments :math:`\elem` are classified by :ref:`segment types <syntax-seg
195195
\frac{
196196
(C \vdashelemexpr e \ok)^\ast
197197
}{
198-
C \vdashelem \{ \EINIT~e^\ast \} : \SPASSIVE
198+
C \vdashelem \{ \ETYPE~et, \EINIT~e^\ast \} : \SPASSIVE
199199
}
200200
201201

0 commit comments

Comments
 (0)