-
Notifications
You must be signed in to change notification settings - Fork 206
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
__wasi_thread_spawn: stop truncating the return value #353
Conversation
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.
So negative values here correspond to -errno values here?
int32_t ret = __imported_wasi_thread_spawn((int32_t) start_arg); | ||
return (uint16_t) ret; | ||
int32_t __wasi_thread_spawn(void* start_arg) { | ||
return __imported_wasi_thread_spawn((int32_t) start_arg); |
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.
Should we match the indentation that is used in the rest of this file?
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.
oops, fixed
as __wasi_errno_t is uint16_t, with the current coding, __pthread_create will never see negative return values from wasi:thread_spawn. eg. (int)(uint16_t)-1 == 65535.
f2af4dc
to
f194c40
Compare
it's documented as `a negative error code.' |
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
as __wasi_errno_t is uint16_t, with the current coding, __pthread_create will never see negative return values from wasi:thread_spawn. eg. (int)(uint16_t)-1 == 65535.
as __wasi_errno_t is uint16_t, with the current coding, __pthread_create will never see negative return values from wasi:thread_spawn.
eg. (int)(uint16_t)-1 == 65535.