From acb4983cf8c137a7c993a17e1954c0168f6eada4 Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Mon, 29 Aug 2016 14:18:12 -0500 Subject: [PATCH] Move the element section before the code section --- BinaryEncoding.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/BinaryEncoding.md b/BinaryEncoding.md index 2bb4ac14..8766d81b 100644 --- a/BinaryEncoding.md +++ b/BinaryEncoding.md @@ -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 @@ -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` @@ -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`