Skip to content

Conversation

@wenyongh
Copy link
Collaborator

@wenyongh wenyongh commented Aug 31, 2022

Fix multi-module issue:
don't call the sub module's function with "$sub_module_name$func_name"
Fix the aot_call_function free argv1 issue
Modify some API comments in wasm_export.h
Fix the wamrc help info

@lum1n0us
Copy link
Contributor

So, we are going to remove the ability of calling functions in a module's dependencies?

@wenyongh
Copy link
Collaborator Author

So, we are going to remove the ability of calling functions in a module's dependencies?

No, it is different concept, we only remove the ability to call a module's import function of the sub module through the name of "$sub_module_name$func_name", as it is really tricky and doesn't align with the spec: by the spec we can only invoke the exported function, but obviously "$sub_module_name$func_name" isn't the name of an export function. In fact we are calling an internal imported function of a module which isn't exported, that should not be allowed.

We support the ability to call an export function, which calls the imported function of a sub module, for example, for the wasm module below:

(module
  (import "mB" "B2" (func $B2 (result i32)))
  (func $C4 (type $3)
    (result i32)
    (local $0 i32)
    call $B2
  )
)

We can call "C4" to invoke the function "B2" of module "mB", but cannot call the function with "$mB$B2": B2 isn't exported.

@yamt
Copy link
Contributor

yamt commented Aug 31, 2022

i hope no one is relying on this functionality.

@wenyongh wenyongh changed the title Fix multi-module issue Fix multi-module and some other issues Aug 31, 2022
@wenyongh wenyongh merged commit 22c235b into bytecodealliance:main Aug 31, 2022
@wenyongh wenyongh deleted the fix_issues branch September 4, 2022 07:59
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
Fix multi-module issue:
  don't call the sub module's function with "$sub_module_name$func_name"
Fix the aot_call_function free argv1 issue
Modify some API comments in wasm_export.h
Fix the wamrc help info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants