diff options
author | Ben Smith <binji@chromium.org> | 2016-09-22 17:39:20 -0700 |
---|---|---|
committer | Ben Smith <binji@chromium.org> | 2016-09-29 11:37:27 -0700 |
commit | b4d2bc2f3fe925a78a7e1ea061106b1f01e8dba2 (patch) | |
tree | f6ae9ce3def03e9945cf2108221b0ab2138fa42a /src/wasm-binary-reader-ast.c | |
parent | cca0d93b8ba2a6ea101f18927eddfbe5ec726dd0 (diff) | |
download | wabt-b4d2bc2f3fe925a78a7e1ea061106b1f01e8dba2.tar.gz wabt-b4d2bc2f3fe925a78a7e1ea061106b1f01e8dba2.tar.bz2 wabt-b4d2bc2f3fe925a78a7e1ea061106b1f01e8dba2.zip |
parse tests for {im,ex}porting tables, etc.
Diffstat (limited to 'src/wasm-binary-reader-ast.c')
-rw-r--r-- | src/wasm-binary-reader-ast.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wasm-binary-reader-ast.c b/src/wasm-binary-reader-ast.c index 0c117d13..032448c9 100644 --- a/src/wasm-binary-reader-ast.c +++ b/src/wasm-binary-reader-ast.c @@ -214,6 +214,7 @@ static WasmResult on_import_func(uint32_t index, assert(sig_index < ctx->module->func_types.size); WasmImport* import = ctx->module->imports.data[index]; + import->kind = WASM_EXTERNAL_KIND_FUNC; import->func.decl.flags = WASM_FUNC_DECLARATION_FLAG_HAS_FUNC_TYPE | WASM_FUNC_DECLARATION_FLAG_SHARED_SIGNATURE; import->func.decl.type_var.type = WASM_VAR_TYPE_INDEX; @@ -233,6 +234,7 @@ static WasmResult on_import_table(uint32_t index, Context* ctx = user_data; assert(index == ctx->module->imports.size - 1); WasmImport* import = ctx->module->imports.data[index]; + import->kind = WASM_EXTERNAL_KIND_TABLE; import->table.elem_limits = *elem_limits; WasmTablePtr table_ptr = &import->table; @@ -247,6 +249,7 @@ static WasmResult on_import_memory(uint32_t index, Context* ctx = user_data; assert(index == ctx->module->imports.size - 1); WasmImport* import = ctx->module->imports.data[index]; + import->kind = WASM_EXTERNAL_KIND_MEMORY; import->memory.page_limits = *page_limits; WasmMemoryPtr memory_ptr = &import->memory; @@ -263,6 +266,7 @@ static WasmResult on_import_global(uint32_t index, Context* ctx = user_data; assert(index == ctx->module->imports.size - 1); WasmImport* import = ctx->module->imports.data[index]; + import->kind = WASM_EXTERNAL_KIND_GLOBAL; import->global.type = type; import->global.mutable_ = mutable_; @@ -426,7 +430,7 @@ static WasmResult on_export(uint32_t index, assert(item_index < ctx->module->funcs.size); break; case WASM_EXTERNAL_KIND_TABLE: - assert(item_index < ctx->module->funcs.size); + assert(item_index < ctx->module->tables.size); break; case WASM_EXTERNAL_KIND_MEMORY: assert(item_index < ctx->module->memories.size); |