mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-06 15:05:19 +00:00
Fix calling multi-module import func issue (#748)
Before calling import function of sub module inst in multi-module mode, we should copy the arguments to output area by using the func inst of sub module inst but not func inst of current module inst.
This commit is contained in:
parent
b1173d1bfc
commit
ed32693fc8
|
@ -3286,8 +3286,21 @@ recover_br_info:
|
|||
/* Only do the copy when it's called from interpreter. */
|
||||
{
|
||||
WASMInterpFrame *outs_area = wasm_exec_env_wasm_stack_top(exec_env);
|
||||
int i;
|
||||
|
||||
#if WASM_ENABLE_MULTI_MODULE != 0
|
||||
if (cur_func->is_import_func) {
|
||||
outs_area->lp = outs_area->operand
|
||||
+ (cur_func->import_func_inst
|
||||
? cur_func->import_func_inst->const_cell_num
|
||||
: 0);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
outs_area->lp = outs_area->operand + cur_func->const_cell_num;
|
||||
for (int i = 0; i < cur_func->param_count; i++) {
|
||||
}
|
||||
for (i = 0; i < cur_func->param_count; i++) {
|
||||
if (cur_func->param_types[i] == VALUE_TYPE_I64
|
||||
|| cur_func->param_types[i] == VALUE_TYPE_F64) {
|
||||
PUT_I64_TO_ADDR(outs_area->lp,
|
||||
|
|
Loading…
Reference in New Issue
Block a user