summaryrefslogtreecommitdiff
path: root/src/wasm-binary-reader.c
diff options
context:
space:
mode:
authorBen Smith <binji@chromium.org>2016-04-25 07:06:51 -0700
committerBen Smith <binji@chromium.org>2016-04-28 23:45:51 -0700
commit8b8647dc8f4cc032d5ce932fd4df22ff3714086d (patch)
treee31423e1b6de4ec582bc1f710d2d309cf38e26f1 /src/wasm-binary-reader.c
parent355ef8dfe1a63b6902d71018684ff69fe6b46922 (diff)
downloadwabt-8b8647dc8f4cc032d5ce932fd4df22ff3714086d.tar.gz
wabt-8b8647dc8f4cc032d5ce932fd4df22ff3714086d.tar.bz2
wabt-8b8647dc8f4cc032d5ce932fd4df22ff3714086d.zip
use short section names
Diffstat (limited to 'src/wasm-binary-reader.c')
-rw-r--r--src/wasm-binary-reader.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/wasm-binary-reader.c b/src/wasm-binary-reader.c
index 8edd856b..e95edb0c 100644
--- a/src/wasm-binary-reader.c
+++ b/src/wasm-binary-reader.c
@@ -403,9 +403,9 @@ WasmResult wasm_read_binary(WasmAllocator* allocator,
in_u32(&ctx, &version, "version");
RAISE_ERROR_UNLESS(&ctx, version == WASM_BINARY_VERSION, "version mismatch");
- /* signatures */
+ /* type */
uint32_t num_signatures = 0;
- if (skip_until_section(&ctx, WASM_SECTION_INDEX_SIGNATURES)) {
+ if (skip_until_section(&ctx, WASM_SECTION_INDEX_TYPE)) {
CALLBACK0(&ctx, begin_signature_section);
uint32_t i;
in_u32_leb128(&ctx, &num_signatures, "signature count");
@@ -439,9 +439,9 @@ WasmResult wasm_read_binary(WasmAllocator* allocator,
CALLBACK0(&ctx, end_signature_section);
}
- /* import_table */
+ /* import */
uint32_t num_imports = 0;
- if (skip_until_section(&ctx, WASM_SECTION_INDEX_IMPORT_TABLE)) {
+ if (skip_until_section(&ctx, WASM_SECTION_INDEX_IMPORT)) {
CALLBACK0(&ctx, begin_import_section);
uint32_t i;
in_u32_leb128(&ctx, &num_imports, "import count");
@@ -463,9 +463,9 @@ WasmResult wasm_read_binary(WasmAllocator* allocator,
CALLBACK0(&ctx, end_import_section);
}
- /* function_signatures */
+ /* function */
uint32_t num_function_signatures = 0;
- if (skip_until_section(&ctx, WASM_SECTION_INDEX_FUNCTION_SIGNATURES)) {
+ if (skip_until_section(&ctx, WASM_SECTION_INDEX_FUNCTION)) {
CALLBACK0(&ctx, begin_function_signatures_section);
uint32_t i;
in_u32_leb128(&ctx, &num_function_signatures, "function signature count");
@@ -480,9 +480,9 @@ WasmResult wasm_read_binary(WasmAllocator* allocator,
CALLBACK0(&ctx, end_function_signatures_section);
}
- /* function_table */
+ /* table */
uint32_t num_function_table_entries;
- if (skip_until_section(&ctx, WASM_SECTION_INDEX_FUNCTION_TABLE)) {
+ if (skip_until_section(&ctx, WASM_SECTION_INDEX_TABLE)) {
CALLBACK0(&ctx, begin_function_table_section);
uint32_t i;
in_u32_leb128(&ctx, &num_function_table_entries,
@@ -519,9 +519,9 @@ WasmResult wasm_read_binary(WasmAllocator* allocator,
CALLBACK0(&ctx, end_memory_section);
}
- /* export_table */
+ /* export */
uint32_t num_exports = 0;
- if (skip_until_section(&ctx, WASM_SECTION_INDEX_EXPORT_TABLE)) {
+ if (skip_until_section(&ctx, WASM_SECTION_INDEX_EXPORT)) {
CALLBACK0(&ctx, begin_export_section);
uint32_t i;
in_u32_leb128(&ctx, &num_exports, "export count");
@@ -540,8 +540,8 @@ WasmResult wasm_read_binary(WasmAllocator* allocator,
CALLBACK0(&ctx, end_export_section);
}
- /* start_function */
- if (skip_until_section(&ctx, WASM_SECTION_INDEX_START_FUNCTION)) {
+ /* start */
+ if (skip_until_section(&ctx, WASM_SECTION_INDEX_START)) {
CALLBACK0(&ctx, begin_start_section);
uint32_t func_index;
in_u32_leb128(&ctx, &func_index, "start function index");
@@ -551,9 +551,9 @@ WasmResult wasm_read_binary(WasmAllocator* allocator,
CALLBACK0(&ctx, end_start_section);
}
- /* function_bodies */
+ /* code */
uint32_t num_function_bodies = 0;
- if (skip_until_section(&ctx, WASM_SECTION_INDEX_FUNCTION_BODIES)) {
+ if (skip_until_section(&ctx, WASM_SECTION_INDEX_CODE)) {
CALLBACK0(&ctx, begin_function_bodies_section);
uint32_t i;
in_u32_leb128(&ctx, &num_function_bodies, "function body count");
@@ -932,8 +932,8 @@ WasmResult wasm_read_binary(WasmAllocator* allocator,
CALLBACK0(&ctx, end_function_bodies_section);
}
- /* data_segments */
- if (skip_until_section(&ctx, WASM_SECTION_INDEX_DATA_SEGMENTS)) {
+ /* data */
+ if (skip_until_section(&ctx, WASM_SECTION_INDEX_DATA)) {
RAISE_ERROR_UNLESS(&ctx, seen_memory_section,
"data segment section without memory section");
CALLBACK0(&ctx, begin_data_segment_section);
@@ -953,9 +953,9 @@ WasmResult wasm_read_binary(WasmAllocator* allocator,
CALLBACK0(&ctx, end_data_segment_section);
}
- /* names */
+ /* name */
if (options->read_debug_names &&
- skip_until_section(&ctx, WASM_SECTION_INDEX_NAMES)) {
+ skip_until_section(&ctx, WASM_SECTION_INDEX_NAME)) {
CALLBACK0(&ctx, begin_names_section);
uint32_t i, num_functions;
in_u32_leb128(&ctx, &num_functions, "function name count");