diff options
author | Ben Smith <binji@chromium.org> | 2016-09-21 17:52:41 -0700 |
---|---|---|
committer | Ben Smith <binji@chromium.org> | 2016-09-29 11:37:27 -0700 |
commit | e84781465fda10f8db3c800de126374e52c1f1d6 (patch) | |
tree | a2e0e92fc5466a049bc78f461b1ba7bc8c67844a /src/wasm-binary-reader-ast.c | |
parent | c560aa303e5dae3b8aa27fcef04ad77a635d3264 (diff) | |
download | wabt-e84781465fda10f8db3c800de126374e52c1f1d6.tar.gz wabt-e84781465fda10f8db3c800de126374e52c1f1d6.tar.bz2 wabt-e84781465fda10f8db3c800de126374e52c1f1d6.zip |
everything compiles, w/ multiple TODOs
Diffstat (limited to 'src/wasm-binary-reader-ast.c')
-rw-r--r-- | src/wasm-binary-reader-ast.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/wasm-binary-reader-ast.c b/src/wasm-binary-reader-ast.c index f0665d05..081ab0d4 100644 --- a/src/wasm-binary-reader-ast.c +++ b/src/wasm-binary-reader-ast.c @@ -202,6 +202,9 @@ static WasmResult on_import_func(uint32_t index, import->func.decl.type_var.type = WASM_VAR_TYPE_INDEX; import->func.decl.type_var.index = sig_index; import->func.decl.sig = ctx->module->func_types.data[sig_index]->sig; + + WasmFuncPtr func_ptr = &import->func; + wasm_append_func_ptr_value(ctx->allocator, &ctx->module->funcs, &func_ptr); return WASM_OK; } @@ -212,8 +215,10 @@ 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->table.elem_limits = *elem_limits; + + WasmTablePtr table_ptr = &import->table; + wasm_append_table_ptr_value(ctx->allocator, &ctx->module->tables, &table_ptr); return WASM_OK; } @@ -223,8 +228,11 @@ 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->memory.page_limits = *page_limits; + + WasmMemoryPtr memory_ptr = &import->memory; + wasm_append_memory_ptr_value(ctx->allocator, &ctx->module->memories, + &memory_ptr); return WASM_OK; } @@ -235,9 +243,12 @@ 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->global.type = type; import->global.mutable_ = mutable_; + + WasmGlobalPtr global_ptr = &import->global; + wasm_append_global_ptr_value(ctx->allocator, &ctx->module->globals, + &global_ptr); return WASM_OK; } |