-
Notifications
You must be signed in to change notification settings - Fork 576
New issue
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
Fix printing of external reference addresses in wasm_application.c #2774
Conversation
core/iwasm/common/wasm_application.c
Outdated
@@ -613,7 +613,7 @@ execute_func(WASMModuleInstanceCommon *module_inst, const char *name, | |||
u.parts[1] = argv1[k + 1]; | |||
k += 2; | |||
if (u.val && u.val != (uintptr_t)-1LL) | |||
os_printf("0x%" PRIxPTR ":ref.extern", (void *)u.val); | |||
os_printf("%p:ref.extern", (void *)u.val); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u.val is uintptr_t. why don't you remove the cast instead?
core/iwasm/common/wasm_application.c
Outdated
@@ -600,7 +600,7 @@ execute_func(WASMModuleInstanceCommon *module_inst, const char *name, | |||
{ | |||
#if UINTPTR_MAX == UINT32_MAX | |||
if (argv1[k] != 0 && argv1[k] != (uint32)-1) | |||
os_printf("0x%" PRIxPTR ":ref.extern", (void *)argv1[k]); | |||
os_printf("%p:ref.extern", (void *)argv1[k]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc, how %p
converts is implementation-defined.
isn't it a problem for repl?
@yamt In fact I'm fine to cast them to uintptr_t but it's from stdint.h, but other type such as uint32 is defined internally, mix usage of them looks a little strange. |
wasm_application.c Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
No description provided.