diff --git a/document/core/exec/modules.rst b/document/core/exec/modules.rst index 578acfa2..d3a158e7 100644 --- a/document/core/exec/modules.rst +++ b/document/core/exec/modules.rst @@ -674,19 +674,17 @@ It is up to the :ref:`embedder ` to define how such conditions are rep 16. For each :ref:`data segment ` :math:`\data_i` in :math:`\module.\MDATAS` whose :ref:`mode ` is of the form :math:`\DACTIVE~\{ \DMEM~\memidx_i, \DOFFSET~\X{dinstr}^\ast_i~\END \}`, do: - a. Assert: :math:`\memidx_i` is :math:`0`. + a. Let :math:`n` be the length of the vector :math:`\data_i.\DINIT`. - b. Let :math:`n` be the length of the vector :math:`\data_i.\DINIT`. + b. :ref:`Execute ` the instruction sequence :math:`\X{dinstr}^\ast_i`. - c. :ref:`Execute ` the instruction sequence :math:`\X{dinstr}^\ast_i`. - - d. :ref:`Execute ` the instruction :math:`\I32.\CONST~0`. + c. :ref:`Execute ` the instruction :math:`\I32.\CONST~0`. - e. :ref:`Execute ` the instruction :math:`\I32.\CONST~n`. + d. :ref:`Execute ` the instruction :math:`\I32.\CONST~n`. - f. :ref:`Execute ` the instruction :math:`\MEMORYINIT~i`. + e. :ref:`Execute ` the instruction :math:`\MEMORYINIT~i`. - g. :ref:`Execute ` the instruction :math:`\DATADROP~i`. + f. :ref:`Execute ` the instruction :math:`\DATADROP~i`. 17. If the :ref:`start function ` :math:`\module.\MSTART` is not empty, then: @@ -737,8 +735,8 @@ where: \F{runelem}_i(\{\ETYPE~\X{et}, \EINIT~\reff^n, \EMODE~\EDECLARATIVE\}) \quad=\\ \qquad (\ELEMDROP~i) \\[1ex] \F{rundata}_i(\{\DINIT~b^n, \DMODE~\DPASSIVE\}) \quad=\quad \epsilon \\ - \F{rundata}_i(\{\DINIT~b^n, \DMODE~\DACTIVE \{\DMEM~0, \DOFFSET~\instr^\ast~\END\}\}) \quad=\\ \qquad - \instr^\ast~(\I32.\CONST~0)~(\I32.\CONST~n)~(\MEMORYINIT~i)~(\DATADROP~i) \\ + \F{rundata}_i(\{\DINIT~b^n, \DMODE~\DACTIVE \{\DMEM~x, \DOFFSET~\instr^\ast~\END\}\}) \quad=\\ \qquad + \instr^\ast~(\I32.\CONST~0)~(\I32.\CONST~n)~(\MEMORYINIT~x~i)~(\DATADROP~i) \\ \end{array} .. note::