Skip to content

Commit

Permalink
Move the element section before the code section (#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewagner authored Aug 31, 2016
1 parent 0b63f3b commit 9bfc116
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions BinaryEncoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ The content of each section is encoded in its `payload_str`.
* [Global](#global-section) section
* [Export](#export-section) section
* [Start](#start-section) section
* [Code](#code-section) section
* [Element](#element-section) section
* [Code](#code-section) section
* [Data](#data-section) section
* [Name](#name-section) section

Expand Down Expand Up @@ -309,20 +309,6 @@ The start section declares the [start function](Modules.md#module-start-function
| ----- | ---- | ----------- |
| index | `varuint32` | start function index |

### Code section

ID: `code`

The code section contains a body for every function in the module.
The count of function declared in the [function section](#function-section)
and function bodies defined in this section must be the same and the `i`th
declaration corresponds to the `i`th function body.

| Field | Type | Description |
| ----- | ---- | ----------- |
| count | `varuint32` | count of function bodies to follow |
| bodies | `function_body*` | sequence of [Function Bodies](#function-bodies) |

### Element section

ID: `elem`
Expand All @@ -343,6 +329,20 @@ a `elem_segment` is:
| num_elem | `varuint32` | number of elements to follow |
| elems | `varuint32*` | sequence of [function indices](Modules.md#function-index-space) |

### Code section

ID: `code`

The code section contains a body for every function in the module.
The count of function declared in the [function section](#function-section)
and function bodies defined in this section must be the same and the `i`th
declaration corresponds to the `i`th function body.

| Field | Type | Description |
| ----- | ---- | ----------- |
| count | `varuint32` | count of function bodies to follow |
| bodies | `function_body*` | sequence of [Function Bodies](#function-bodies) |

### Data section

ID: `data`
Expand Down

0 comments on commit 9bfc116

Please sign in to comment.