rust-lang / rust-lang/reference

asm.rules.stack-below-sp is ambiguous

Open
#2,053 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.6k
Forks
607
PR merge metrics
PR metrics pending

Description

Stacks can grow in different directions and diagrams can be top-to-bottom or bottom-to-top.
Apparently the SPARC arch can select whether the stack grows up or down.

This section of the reference talks about stack space below the stack pointer, but because of different models of how stacks can work, it's not entirely clear what that means.

  • If the text is meant 'by address', then the rule changes based on the arch
  • If the text is meant logically, then it should probably say so. And it should still specify the direction.

Instead of up and down, maybe it should be specified in terms of 'used' vs 'potential' stack? Or 'active' and 'inactive'?

Or maybe describe the contents you're allowed to interact with. For example, are you allowed to read the stack frame of the caller of the current function?

The more I read the current text, the less I'm sure what it actually says.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Rust Reference inline-assembly section linked in the issue, especially the rule named asm.rules.stack-below-sp, and compare its wording with the SPARC stack-direction behavior mentioned. Clarify whether the rule is address-based or logical, specify the relevant direction or stack region, and ensure the resulting text explains what stack contents may be accessed.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.