From babba5751d9730165f53dfe4b4e0ea0e76d9550b Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Tue, 23 Jul 2024 11:38:07 +0200 Subject: [PATCH] Fix binary encoding of tag types --- document/core/binary/modules.rst | 2 +- document/core/binary/types.rst | 7 ++----- document/core/syntax/modules.rst | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/document/core/binary/modules.rst b/document/core/binary/modules.rst index 8135c7ccaf..be424e86d7 100644 --- a/document/core/binary/modules.rst +++ b/document/core/binary/modules.rst @@ -181,7 +181,7 @@ It decodes into a vector of :ref:`imports ` that represent the |M \hex{01}~~\X{tt}{:}\Btabletype &\Rightarrow& \IDTABLE~\X{tt} \\ &&|& \hex{02}~~\X{mt}{:}\Bmemtype &\Rightarrow& \IDMEM~\X{mt} \\ &&|& \hex{03}~~\X{gt}{:}\Bglobaltype &\Rightarrow& \IDGLOBAL~\X{gt} \\ &&|& - \hex{04}~~\X{tt}{:}\Btagtype &\Rightarrow& \IDTAG~\X{tt} \\ + \hex{04}~~x{:}\Btagtype &\Rightarrow& \IDTAG~x \\ \end{array} diff --git a/document/core/binary/types.rst b/document/core/binary/types.rst index 525cc33739..c6212ed643 100644 --- a/document/core/binary/types.rst +++ b/document/core/binary/types.rst @@ -321,17 +321,14 @@ Global Types Tag Types ~~~~~~~~~ -:ref:`Tag types ` are encoded by their function type. +:ref:`Tag types ` are encoded by a :ref:`type index ` denoting a :ref:`function type `. .. math:: \begin{array}{llclll} \production{tag type} & \Btagtype &::=& - \hex{00}~~ft{:}\Bfunctype &\Rightarrow& ft \\ + \hex{00}~~x{:}\Btypeidx &\Rightarrow& x \\ \end{array} -The |Bfunctype| of a tag is used to characterise exceptions. -The :math:`\hex{00}` bit signifies an exception and is currently the only allowed value. - .. note:: In future versions of WebAssembly, the preceding zero byte may encode additional flags. diff --git a/document/core/syntax/modules.rst b/document/core/syntax/modules.rst index 8ffebb9ded..a0ea7fe750 100644 --- a/document/core/syntax/modules.rst +++ b/document/core/syntax/modules.rst @@ -445,7 +445,7 @@ The |MIMPORTS| component of a module defines a set of *imports* that are require \IDTABLE~\tabletype \\&&|& \IDMEM~\memtype \\&&|& \IDGLOBAL~\globaltype \\&&|& - \IDTAG~\tagtype \\ + \IDTAG~\typeidx \\ \end{array} Each import is labeled by a two-level :ref:`name ` space, consisting of a |IMODULE| name and a |INAME| for an entity within that module.