Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/inline-assembly.md
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ let _: () = unsafe {

r[asm.options.supported-options.nostack]
- `nostack`: The assembly code does not push data to the stack, or write to the stack red-zone (if supported by the target).
If this option is *not* used then the stack pointer is guaranteed to be suitably aligned (according to the target ABI) for a function call.
If this option is *not* used then the stack pointer is guaranteed by the compiler to be suitably aligned (according to the target ABI) for a function call at the start of the assembly code.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the start of the assembly code

this makes me feel weird — i suspect that inline asm isn't allowed to modify the stack pointer at all? but i'm not sure if that's true, i don't want to write it in the reference without more background info.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's already a requirement that the stack pointer must be restored to its original value before returning from an asm block. This applies regardless of whether nostack is used.


<!-- no_run: Test has undefined behavior at runtime -->
```rust,no_run
Expand Down