Skip to content

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

Merged
bors merged 3 commits into
rust-lang:masterfrom
Aaron1011:fix/function-arguments-naked
Aug 8, 2020
Merged

Don't call a function in function-arguments-naked.rs#75224
bors merged 3 commits into
rust-lang:masterfrom
Aaron1011:fix/function-arguments-naked

Conversation

@Aaron1011

Copy link
Copy Markdown
Contributor

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.

Fixesrust-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
Copy Markdown
Contributor

r? @nikomatsakis

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

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

Copy link
Copy Markdown
ContributorAuthor

r? @Amanieu

@Amanieu

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

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

Comment threadsrc/test/debuginfo/function-arguments-naked.rs Outdated
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
@Amanieu

Copy link
Copy Markdown
Member

@bors r+ rollup

@bors

bors commented Aug 7, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit c34c77c has been approved by Amanieu

@borsbors 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
@JohnTitorJohnTitor mentioned this pull request Aug 8, 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:masterAug 8, 2020
@cuvipercuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: 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

@Aaron1011@rust-highfive@Amanieu@bors@cuviper@nikomatsakis