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

Change direction in wording around stack unwinding #1781

Open
wucke13 opened this issue Aug 15, 2024 · 2 comments
Open

Change direction in wording around stack unwinding #1781

wucke13 opened this issue Aug 15, 2024 · 2 comments

Comments

@wucke13
Copy link

wucke13 commented Aug 15, 2024

The original sentence reads:

Taking a branch unwinds the operand stack up to the height where the targeted structured control instruction was entered.

However, usually one speaks of the top of the stack as where new values are pushed to/popped from. Following that metaphor when talking about unwinding, unwinding goes down in the stack. Hence the following proposal:

Taking a branch unwinds the operand stack updown to the height where the targeted structured control instruction was entered.

https://github.com/WebAssembly/spec/blob/bbe955d1fab3d7f74f4e9d19d77df85e482c397f/document/core/syntax/instructions.rst?plain=1#L691C45-L691C48

@rossberg
Copy link
Member

The "up to" here is used in the sense of "up to some limit", not suggesting any stack direction.

@wucke13
Copy link
Author

wucke13 commented Aug 15, 2024

Ah I see! I'm wondering if "down to some limit" could not work the same on the semantics side, while adhering to the intuition of a stack. Like, "to a limit" would work as well, but if a direction is provided, why not take the more fitting one given the adjacent metaphor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants