From 8500c631f8d056b8c95624c02f683266a2cafae9 Mon Sep 17 00:00:00 2001 From: rossberg-chromium Date: Tue, 5 Apr 2016 13:46:58 +0200 Subject: [PATCH 1/2] Reorder section size field --- BinaryEncoding.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BinaryEncoding.md b/BinaryEncoding.md index 3030270d..5ed88057 100644 --- a/BinaryEncoding.md +++ b/BinaryEncoding.md @@ -81,16 +81,18 @@ The module starts with a preamble of two fields: This preamble is followed by a sequence of sections. Each section is identified by an immediate string. Sections whose identity is unknown to the WebAssembly implementation are ignored and this is supported by including the size in bytes -for all sections. The encoding of all sections begins as follows: +for all sections. The encoding of sections is structured as follows: | Field | Type | Description | | ----- | ----- | ----- | -| size | `varuint32` | size of this section in bytes, excluding this size | | id_len | `varuint32` | section identifier string length | | id_str | `bytes` | section identifier string of id_len bytes | +| payload_len | `varuint32` | size of this section in bytes | +| payload_str | `bytes` | content of this section, of length payload_len | Each section is optional and may appear at most once. Known sections (from this list) may not appear out of order. +The actual content of each section is encoded in its `payload_str`. * [Signatures](#signatures-section) section * [Import Table](#import-table-section) section From 67e6faa3e1340277067b0d9c6459c34e6ad20123 Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Wed, 6 Apr 2016 17:02:34 +0200 Subject: [PATCH 2/2] Wording nit --- BinaryEncoding.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BinaryEncoding.md b/BinaryEncoding.md index 5ed88057..38feb89b 100644 --- a/BinaryEncoding.md +++ b/BinaryEncoding.md @@ -92,7 +92,7 @@ for all sections. The encoding of sections is structured as follows: Each section is optional and may appear at most once. Known sections (from this list) may not appear out of order. -The actual content of each section is encoded in its `payload_str`. +The content of each section is encoded in its `payload_str`. * [Signatures](#signatures-section) section * [Import Table](#import-table-section) section