Enable multi-module support for wasm-c-api (#426)

it is allowed that all imported functions and globals can be
linked by multi-module feature automatically or by wasm-c-api manually
This commit is contained in:
lum1n0us
2020-10-16 17:43:57 +08:00
committed by GitHub
parent f1fe5d7872
commit 4787b150b8
26 changed files with 550 additions and 185 deletions

View File

@ -1270,11 +1270,7 @@ recover_br_info:
WASMType *func_type;
uint32 off, ret_offset;
uint8 *ret_types;
if (cur_func->is_import_func
#if WASM_ENABLE_MULTI_MODULE != 0
&& !cur_func->import_func_inst
#endif
)
if (cur_func->is_import_func)
func_type = cur_func->u.func_import->func_type;
else
func_type = cur_func->u.func->func_type;
@ -1354,11 +1350,7 @@ recover_br_info:
/* always call module own functions */
cur_func = module->functions + fidx;
if (cur_func->is_import_func
#if WASM_ENABLE_MULTI_MODULE != 0
&& !cur_func->import_func_inst
#endif
)
if (cur_func->is_import_func)
cur_func_type = cur_func->u.func_import->func_type;
else
cur_func_type = cur_func->u.func->func_type;
@ -3253,11 +3245,7 @@ recover_br_info:
* values' offset so we must skip remain return values' offsets.
*/
WASMType *func_type;
if (cur_func->is_import_func
#if WASM_ENABLE_MULTI_MODULE != 0
&& !cur_func->import_func_inst
#endif
)
if (cur_func->is_import_func)
func_type = cur_func->u.func_import->func_type;
else
func_type = cur_func->u.func->func_type;