Skip to content

Commit b7b4a91

Browse files
authored
[spec] Validation for exact heap types (#97)
Add Heaptype_ok/exact and Heaptype_sub/exact-l rules for exact heap types in the spectec and in the doc.
1 parent c639c09 commit b7b4a91

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

document/core/valid/matching.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ Heap Types
3939
$${rule-prose: Heaptype_sub}
4040

4141
$${rule:
42-
{Heaptype_sub/refl Heaptype_sub/trans}
42+
{Heaptype_sub/refl Heaptype_sub/exact-l}
43+
{Heaptype_sub/trans}
4344
{Heaptype_sub/eq-any Heaptype_sub/i31-eq Heaptype_sub/struct-eq Heaptype_sub/array-eq}
4445
{Heaptype_sub/struct Heaptype_sub/array Heaptype_sub/func}
4546
{Heaptype_sub/typeidx-l Heaptype_sub/typeidx-r}

document/core/valid/types.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ $${rule-prose: Heaptype_ok/abs}
5858

5959
$${rule: Heaptype_ok/abs}
6060

61+
$${rule-prose: Heaptype_ok/exact}
62+
63+
$${rule: Heaptype_ok/exact}
64+
6165

6266
.. index:: reference type, heap type
6367
pair: validation; reference type

specification/wasm-latest/2.1-validation.types.spectec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ rule Heaptype_ok/typeuse:
2424
C |- typeuse : OK
2525
-- Typeuse_ok: C |- typeuse : OK
2626

27+
rule Heaptype_ok/exact:
28+
C |- EXACT typeuse : OK
29+
-- Typeuse_ok: C |- typeuse : OK
30+
2731
rule Reftype_ok:
2832
C |- REF NULL? heaptype : OK
2933
-- Heaptype_ok: C |- heaptype : OK

specification/wasm-latest/2.2-validation.subtyping.spectec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ rule Vectype_sub:
2020
rule Heaptype_sub/refl:
2121
C |- heaptype <: heaptype
2222

23+
rule Heaptype_sub/exact-l:
24+
C |- EXACT typeuse <: heaptype
25+
-- Heaptype_sub: C |- typeuse <: heaptype
26+
2327
rule Heaptype_sub/trans:
2428
C |- heaptype_1 <: heaptype_2
2529
-- Heaptype_ok: C |- heaptype' : OK

0 commit comments

Comments
 (0)