From 34337b438af5d67ef4075f08267be6fe59e85edc Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Thu, 9 Jul 2026 10:37:01 +0200 Subject: [PATCH] [spec] Additional implementaiton limits --- document/core/appendix/implementation.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/document/core/appendix/implementation.rst b/document/core/appendix/implementation.rst index 15fe69357c..e40febbdc5 100644 --- a/document/core/appendix/implementation.rst +++ b/document/core/appendix/implementation.rst @@ -56,6 +56,8 @@ An implementation may impose restrictions on the following dimensions of a modul * the nesting depth of :ref:`structured control instructions ` * the number of :ref:`label indices ` in a |BRTABLE| instruction * the number of instructions in a :ref:`constant ` :ref:`expression ` +* the number of instructions between a :ref:`branch instruction ` and its target +* the nesting depth of blocks between a :ref:`branch instruction ` and its target * the length of the array in a |ARRAYNEWFIXED| instruction * the length of an :ref:`element segment ` * the length of a :ref:`data segment ` @@ -63,7 +65,7 @@ An implementation may impose restrictions on the following dimensions of a modul * the range of :ref:`characters ` in a :ref:`name ` If the limits of an implementation are exceeded for a given module, -then the implementation may reject the :ref:`validation `, compilation, or :ref:`instantiation ` of that module with an embedder-specific error. +then the implementation may reject the :ref:`validation `, compilation, or :ref:`instantiation ` of that module with an implementation-specific error. .. note:: The last item allows :ref:`embedders ` that operate in limited environments without support for @@ -142,11 +144,14 @@ Restrictions on the following dimensions may be imposed during :ref:`execution < * the number of :ref:`frames ` on the :ref:`stack ` * the number of :ref:`labels ` on the :ref:`stack ` * the number of :ref:`values ` on the :ref:`stack ` +* the number of :ref:`handlers ` on the :ref:`stack ` +* the number of :ref:`labels ` dropped from the :ref:`stack ` by a :ref:`branch instruction ` +* the number of :ref:`values ` dropped from the :ref:`stack ` by a :ref:`branch instruction ` If the runtime limits of an implementation are exceeded during execution of a computation, -then it may terminate that computation and report an embedder-specific error to the invoking code. +then it may terminate that computation and report an implementation-specific error to the invoking code. -Some of the above limits may already be verified during instantiation, in which case an implementation may report exceedance in the same manner as for :ref:`syntactic limits `. +Some of the above limits may already be verified during :ref:`validation ` or :ref:`instantiation `, in which case an implementation may report exceedance in the same manner as for :ref:`syntactic limits `. .. note:: Concrete limits are usually not fixed but may be dependent on specifics, interdependent, vary over time, or depend on other implementation- or embedder-specific situations or events.