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

Don't call a function in function-arguments-naked.rs #75224

Merged
merged 3 commits into from
Aug 8, 2020

Conversation

Aaron1011
Copy link
Member

Fixes #75096

It's U.B. to use anything other than inline assmebling in a naked
function. Fortunately, the #break directive works fine without
anything in the function body.

Fixes rust-lang#75096

It's U.B. to use anything other than inline assmebling in a naked
function. Fortunately, the `#break` directive works fine without
anything in the function body.
@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 6, 2020
@Aaron1011
Copy link
Member Author

r? @Amanieu

@rust-highfive rust-highfive assigned Amanieu and unassigned nikomatsakis Aug 7, 2020
@Amanieu
Copy link
Member

Amanieu commented Aug 7, 2020

It is also UB to not have anything in a naked function. You need an asm! since #[naked] will not emit a return instruction for you.

We need to use inline assembly, which is inherently platform-specific.
@Aaron1011
Copy link
Member Author

@Amanieu: I've added a ret instruction, and make the testx86_64 only.

@Amanieu
Copy link
Member

Amanieu commented Aug 7, 2020

@bors r rollup

@bors
Copy link
Contributor

bors commented Aug 7, 2020

📌 Commit c34c77c has been approved by Amanieu

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 7, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 8, 2020
Rollup of 7 pull requests

Successful merges:

 - rust-lang#75224 (Don't call a function in function-arguments-naked.rs)
 - rust-lang#75237 (Display elided lifetime for non-reference type in doc)
 - rust-lang#75250 (make MaybeUninit::as_(mut_)ptr const)
 - rust-lang#75253 (clean up const-hacks in int endianess conversion functions)
 - rust-lang#75259 (Add missing backtick)
 - rust-lang#75267 (Small cleanup)
 - rust-lang#75270 (fix a couple of clippy findings)

Failed merges:

r? @ghost
@bors bors merged commit f5d2ffd into rust-lang:master Aug 8, 2020
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assertion `MFI.isCalleeSavedInfoValid() && "CalleeSavedInfo not calculated"' failed on AArch64
6 participants