-
Notifications
You must be signed in to change notification settings - Fork 216
Port _Exit() to use wasip2 method #611
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1084,7 +1084,10 @@ extern bool environment_initial_cwd(wasip2_string_t *ret); | |
|
||
// Imported Functions from `wasi:cli/[email protected]` | ||
// Exit the current instance and any linked instances. | ||
extern void exit_exit(exit_result_void_void_t *status); | ||
// NOTE: This file has been manually edited to add the _Noreturn | ||
// annotation on exit_exit(). If the file is re-generated, this | ||
// annotation will have to be re-added. | ||
_Noreturn extern void exit_exit(exit_result_void_void_t *status); | ||
|
||
// Imported Functions from `wasi:io/[email protected]` | ||
// Returns a string that is suitable to assist humans in debugging | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,11 @@ extern void __wasm_import_environment_get_arguments(int32_t); | |
__attribute__((__import_module__("wasi:cli/[email protected]"), __import_name__("initial-cwd"))) | ||
extern void __wasm_import_environment_initial_cwd(int32_t); | ||
|
||
// NOTE: This file has been manually edited to add the _Noreturn | ||
// annotation on __wasm_import_exit_exit(). If the file is re-generated, this | ||
// annotation will have to be re-added. | ||
__attribute__((__import_module__("wasi:cli/[email protected]"), __import_name__("exit"))) | ||
extern void __wasm_import_exit_exit(int32_t); | ||
_Noreturn extern void __wasm_import_exit_exit(int32_t); | ||
|
||
__attribute__((__import_module__("wasi:io/[email protected]"), __import_name__("[method]error.to-debug-string"))) | ||
extern void __wasm_import_io_error_method_error_to_debug_string(int32_t, int32_t); | ||
|
@@ -1068,7 +1071,7 @@ bool environment_initial_cwd(wasip2_string_t *ret) { | |
return option.is_some; | ||
} | ||
|
||
void exit_exit(exit_result_void_void_t *status) { | ||
_Noreturn void exit_exit(exit_result_void_void_t *status) { | ||
int32_t result; | ||
if ((*status).is_err) { | ||
result = 1; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Since editing these files is unexpected, but I agree necessary in this case, please add to the comment here noting this signature has been edited from the generated code. I'm not sure if anyone will ever read the comment, but it might make it stick out more in a git diff if the files get regenerated in the future.
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.
Done in 58c47bc