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

Clarify whether inline assembly nomem implies nostack #1350

Open
lukas-code opened this issue Apr 18, 2023 · 0 comments
Open

Clarify whether inline assembly nomem implies nostack #1350

lukas-code opened this issue Apr 18, 2023 · 0 comments
Labels
A-asm Area: inline assembly

Comments

@lukas-code
Copy link

Location: https://doc.rust-lang.org/nightly/reference/inline-assembly.html#options

i.e. is the following UB:

pub fn foo() {
    unsafe { core::arch::asm!("push rax", "pop rax", options(nomem)) }
}

This code obviously does write to memory, but the reference only talks about global variables for nomem, which make me think this probably fine? It would be nice to clarify whether nomem inline assembly is allowed to access to stack at all.

@ehuss ehuss added the A-asm Area: inline assembly label Jun 27, 2023
mtoohey31 added a commit to KidneyOS/KidneyOS that referenced this issue Mar 23, 2024
This might be fine, but it's currently unclear so we probably shouldn't.
See rust-lang/reference#1350 for details.
mtoohey31 added a commit to KidneyOS/KidneyOS that referenced this issue Mar 23, 2024
This might be fine, but it's currently unclear so we probably shouldn't.
See rust-lang/reference#1350 for details.
mtoohey31 added a commit to KidneyOS/KidneyOS that referenced this issue Apr 1, 2024
This might be fine, but it's currently unclear so we probably shouldn't.
See rust-lang/reference#1350 for details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-asm Area: inline assembly
Projects
None yet
Development

No branches or pull requests

2 participants