Skip to content
This repository was archived by the owner on Aug 17, 2022. It is now read-only.

Commit 82b196e

Browse files
authored
Merge pull request #13 from alexcrichton/comments
Address a few comments about binary encoding
2 parents a4890f4 + 023f4f7 commit 82b196e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

proposals/module-linking/Binary.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ type ::=
4444
functype ::= rt_1:resulttype rt_2:resulttype -> rt_1 -> rt-2
4545
4646
moduletype ::=
47-
i*:vec(import) e*:vec(exporttype) -> {imports i, exports e}
47+
i*:vec(import) e*:vec(exporttype) -> {imports i*, exports e*}
4848
49-
instancetype ::= e*:vec(exporttype) -> {exports e}
49+
instancetype ::= e*:vec(exporttype) -> {exports e*}
5050
5151
exporttype ::= nm:name d:importdesc -> {name nm, desc d}
5252
```
@@ -70,12 +70,12 @@ Updates to
7070
[`importdesc`](https://webassembly.github.io/spec/core/binary/modules.html#binary-importdesc)
7171

7272
```
73-
# note that `0x01 0xc0` in MVP-wasm specifies a 1-byte module field of the
74-
# string 0xc0, but the 0xc0 byte is not valid utf-8, so this was not a valid
75-
# MVP import
73+
# note that in MVP wasm this encoding specifies a zero-length field name, but
74+
# the following `0xff` byte is not a valid `importdesc` prefix, so this encoding
75+
# is invalid in MVP wasm
7676
import ::=
7777
...
78-
mod:name 0x01 0xc0 d:importdesc -> {module mod, desc d}
78+
mod:name 0x00 0xff d:importdesc -> {module mod, desc d}
7979
8080
importdesc ::=
8181
...
@@ -110,7 +110,7 @@ A new section defining local instances
110110
```
111111
instancesec ::= i*:section_101(vec(instancedef)) -> i*
112112
113-
instancedef ::= 0x00 m:moduleidx e*:vec(exportdesc) -> {instantiate m, imports e}
113+
instancedef ::= 0x00 m:moduleidx e*:vec(exportdesc) -> {instantiate m, imports e*}
114114
```
115115

116116
This defines instances in the module, appending to the instance index space.

0 commit comments

Comments
 (0)