Skip to content
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 issue-506.rs by adding a void-returning stub in the runtime. #2957

Closed
bblum opened this issue Jul 18, 2012 · 2 comments
Closed

Fix issue-506.rs by adding a void-returning stub in the runtime. #2957

bblum opened this issue Jul 18, 2012 · 2 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows A-testsuite Area: The testsuite used to check the correctness of rustc C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Milestone

Comments

@bblum
Copy link
Contributor

bblum commented Jul 18, 2012

In preparation for removing unsupervise() from the runtime, I had to replace calls to it with calls to something else in all the test cases. But the test for issue #506 needs a fn(), and there are no such functions left in the runtime builtins with unsupervise gone.

The hack I pulled to use get_task_id instead worked on all platforms but darwin, where it compiled to get the return value by reference instead of in a register.

Adding a wrapper wouldn't work because the test case's intent is to call the function directly. This probably requires a snapshot.

Currently xfailed on all platforms.

@eholk
Copy link
Contributor

eholk commented Jul 19, 2012

The other option is just to find some other function in the runtime to call. It doesn't even particularly matter if it returns void, since Rust won't check the return type.

@bblum
Copy link
Contributor Author

bblum commented Jul 19, 2012

No, I did that, and that was the problem. On windows and linux it works fine. On darwin, the c_shim is built to attempt to return an intptr_t by reference instead of by %rax. The caller expects nothing returned, so passes in NULL as the return reference pointer.

@ghost ghost assigned bblum Jul 19, 2012
@ghost ghost assigned bblum Aug 8, 2012
@bblum bblum closed this as completed in a076c28 Aug 17, 2012
@bblum bblum removed their assignment Jun 16, 2014
RalfJung pushed a commit to RalfJung/rust that referenced this issue Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows A-testsuite Area: The testsuite used to check the correctness of rustc C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

2 participants