You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[spec] Adapt OOB behaviour in spec; store typing (WebAssembly#129)
* [interpreter] Simplify zero-len and drop semantics
* Update overview
* [spec] Change drop semantics
* [spec] Forgot to adjust prose for *.init ops
* [spec] Adapt to early OOB checks
* [spec] Fix OOB for table rules
* [spec] Spec memory OOB
* [spec] Extend store typing to elem and data instances
* Apply suggestions from code review
Co-Authored-By: Ryan Hunt <[email protected]>
* Comments
* [spec] Fix uses of table.set
Copy file name to clipboardExpand all lines: document/core/appendix/properties.rst
+108-7Lines changed: 108 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,6 +100,10 @@ Module instances are classified by *module contexts*, which are regular :ref:`co
100
100
101
101
* Each :ref:`global instance <syntax-globalinst>` :math:`\globalinst_i` in :math:`S.\SGLOBALS` must be :ref:`valid <valid-globalinst>` with some :ref:`global type <syntax-globaltype>` :math:`\globaltype_i`.
102
102
103
+
* Each :ref:`element instance <syntax-eleminst>` :math:`\eleminst_i` in :math:`S.\SELEMS` must be :ref:`valid <valid-eleminst>`.
104
+
105
+
* Each :ref:`data instance <syntax-datainst>` :math:`\datainst_i` in :math:`S.\SDATAS` must be :ref:`valid <valid-datainst>`.
106
+
103
107
* Then the store is valid.
104
108
105
109
.. math::
@@ -114,11 +118,17 @@ Module instances are classified by *module contexts*, which are regular :ref:`co
114
118
\qquad
115
119
(S \vdashglobalinst\globalinst : \globaltype)^\ast
116
120
\\
121
+
(S \vdasheleminst\eleminst\ok)^\ast
122
+
\qquad
123
+
(S \vdashdatainst\datainst\ok)^\ast
124
+
\\
117
125
S = \{
118
126
\SFUNCS~\funcinst^\ast,
119
127
\STABLES~\tableinst^\ast,
120
128
\SMEMS~\meminst^\ast,
121
-
\SGLOBALS~\globalinst^\ast \}
129
+
\SGLOBALS~\globalinst^\ast,
130
+
\SELEMS~\eleminst^\ast,
131
+
\SDATAS~\datainst^\ast \}
122
132
\end{array}
123
133
}{
124
134
\vdashstore S \ok
@@ -224,7 +234,7 @@ Module instances are classified by *module contexts*, which are regular :ref:`co
* For each :ref:`function address <syntax-funcaddr>` :math:`\X{fa}_i` in the table elements :math:`\X{fa}^\ast`:
285
+
286
+
* The :ref:`external value <syntax-externval>` :math:`\EVFUNC~\X{fa}` must be :ref:`valid <valid-externval-func>` with some :ref:`external type <syntax-externtype>` :math:`\ETFUNC~\X{ft}`.
287
+
288
+
* Then the element instance is valid.
289
+
290
+
.. math::
291
+
\frac{
292
+
(S \vdashexternval\EVFUNC~\X{fa} : \ETFUNC~\functype)^\ast
.. index:: external type, export instance, name, external value
269
314
.. _valid-exportinst:
270
315
@@ -299,6 +344,10 @@ Module instances are classified by *module contexts*, which are regular :ref:`co
299
344
300
345
* For each :ref:`global address <syntax-globaladdr>` :math:`\globaladdr_i` in :math:`\moduleinst.\MIGLOBALS`, the :ref:`external value <syntax-externval>` :math:`\EVGLOBAL~\globaladdr_i` must be :ref:`valid <valid-externval-global>` with some :ref:`external type <syntax-externtype>` :math:`\ETGLOBAL~\globaltype_i`.
301
346
347
+
* For each :ref:`element address <syntax-elemaddr>` :math:`\elemaddr_i` in :math:`\moduleinst.\MIELEMS`, the :ref:`element instance <syntax-eleminst>` :math:`S.\SELEMS[\elemaddr_i]` must be :ref:`valid <valid-eleminst>`.
348
+
349
+
* For each :ref:`data address <syntax-dataaddr>` :math:`\dataaddr_i` in :math:`\moduleinst.\MIDATAS`, the :ref:`data instance <syntax-datainst>` :math:`S.\SDATAS[\dataaddr_i]` must be :ref:`valid <valid-datainst>`.
350
+
302
351
* Each :ref:`export instance <syntax-exportinst>` :math:`\exportinst_i` in :math:`\moduleinst.\MIEXPORTS` must be :ref:`valid <valid-exportinst>`.
303
352
304
353
* For each :ref:`export instance <syntax-exportinst>` :math:`\exportinst_i` in :math:`\moduleinst.\MIEXPORTS`, the :ref:`name <syntax-name>` :math:`\exportinst_i.\EINAME` must be different from any other name occurring in :math:`\moduleinst.\MIEXPORTS`.
@@ -327,6 +376,10 @@ Module instances are classified by *module contexts*, which are regular :ref:`co
327
376
\qquad
328
377
(S \vdashexternval\EVGLOBAL~\globaladdr : \ETGLOBAL~\globaltype)^\ast
329
378
\\
379
+
(S \vdasheleminst S.\SELEMS[\elemaddr] \ok)^\ast
380
+
\qquad
381
+
(S \vdashdatainst S.\SDATAS[\dataaddr] \ok)^\ast
382
+
\\
330
383
(S \vdashexportinst\exportinst\ok)^\ast
331
384
\qquad
332
385
(\exportinst.\EINAME)^\ast ~\mbox{disjoint}
@@ -338,7 +391,9 @@ Module instances are classified by *module contexts*, which are regular :ref:`co
338
391
\MIFUNCS & \funcaddr^\ast, \\
339
392
\MITABLES & \tableaddr^\ast, \\
340
393
\MIMEMS & \memaddr^\ast, \\
341
-
\MIGLOBALS & \globaladdr^\ast \\
394
+
\MIGLOBALS & \globaladdr^\ast, \\
395
+
\MIELEMS & \elemaddr^\ast, \\
396
+
\MIDATAS & \dataaddr^\ast, \\
342
397
\MIEXPORTS & \exportinst^\ast ~\} : \{
343
398
\begin{array}[t]{@{}l@{~}l@{}}
344
399
\CTYPES & \functype^\ast, \\
@@ -560,6 +615,10 @@ a store state :math:`S'` extends state :math:`S`, written :math:`S \extendsto S'
560
615
561
616
* The length of :math:`S.\SGLOBALS` must not shrink.
562
617
618
+
* The length of :math:`S.\SELEMS` must not shrink.
619
+
620
+
* The length of :math:`S.\SDATAS` must not shrink.
621
+
563
622
* For each :ref:`function instance <syntax-funcinst>` :math:`\funcinst_i` in the original :math:`S.\SFUNCS`, the new function instance must be an :ref:`extension <extend-funcinst>` of the old.
564
623
565
624
* For each :ref:`table instance <syntax-tableinst>` :math:`\tableinst_i` in the original :math:`S.\STABLES`, the new table instance must be an :ref:`extension <extend-tableinst>` of the old.
@@ -568,21 +627,31 @@ a store state :math:`S'` extends state :math:`S`, written :math:`S \extendsto S'
568
627
569
628
* For each :ref:`global instance <syntax-globalinst>` :math:`\globalinst_i` in the original :math:`S.\SGLOBALS`, the new global instance must be an :ref:`extension <extend-globalinst>` of the old.
570
629
630
+
* For each :ref:`element instance <syntax-eleminst>` :math:`\eleminst_i` in the original :math:`S.\SELEMS`, the new global instance must be an :ref:`extension <extend-eleminst>` of the old.
631
+
632
+
* For each :ref:`data instance <syntax-datainst>` :math:`\datainst_i` in the original :math:`S.\SDATAS`, the new global instance must be an :ref:`extension <extend-datainst>` of the old.
0 commit comments