We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thanks for filing a bug or defect report! Please fill out the TODOs below.
Describe the bug or defect here.
When calling wasm_application_execute_func the returned value is not passed back to the caller.
Upload the related wasm file, wast file or the source files if you can.
int32_t run_me(void) { return 10; }
You can't get 10 by calling wasm_application_execute_func and looking in argv[0] for it.
Tell us how to reproduce this bug or defect.
Tell us what should happen argv[0] should have the returned value of the function, at least for simple types (i32 for example)
Tell us what happens instead
Anything else you'd like to add?
a patch that works at least for i32 is
diff --git i/core/iwasm/common/wasm_application.c w/core/iwasm/common/wasm_application.c index 3b3be16c..42a21a99 100644 --- i/core/iwasm/common/wasm_application.c +++ w/core/iwasm/common/wasm_application.c @@ -685,6 +685,10 @@ execute_func(WASMModuleInstanceCommon *module_inst, const char *name, goto fail; } + if (argv && type->result_count == 1 && type->types[type->param_count] == VALUE_TYPE_I32) + /* copy the return value */ + *(int *)argv = (int)argv1[0]; + #if WASM_ENABLE_GC != 0 ref_type_map = type->result_ref_type_maps; #endif
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Thanks for filing a bug or defect report! Please fill out the TODOs below.
Subject of the issue
Describe the bug or defect here.
When calling wasm_application_execute_func the returned value is not passed back to the caller.
Test case
Upload the related wasm file, wast file or the source files if you can.
int32_t run_me(void) {
return 10;
}
You can't get 10 by calling wasm_application_execute_func and looking in argv[0] for it.
Your environment
Steps to reproduce
Tell us how to reproduce this bug or defect.
Expected behavior
Tell us what should happen
argv[0] should have the returned value of the function, at least for simple types (i32 for example)
Actual behavior
Tell us what happens instead
Extra Info
Anything else you'd like to add?
a patch that works at least for i32 is
The text was updated successfully, but these errors were encountered: