Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Should index of rethrow index blocks (like branch) or just try blocks? #18

Closed
lukewagner opened this issue May 17, 2017 · 4 comments
Closed

Comments

@lukewagner
Copy link
Member

For nested rethrow my initial expectation was that rethrow's label would only index try blocks (effectively "filtering" the block stack for try blocks) rather than simply indexing the block stack. This seems marginally more convenient for producers and it doesn't seem like any trouble for anyone. I don't have a strong opinion here, though.

@KarlSchimpf
Copy link
Contributor

The main argument for using a 'label' is that it is a concept already in WebAssembly. However, the expectation is that the label only makes sense if it corresponds to the try block.

@eholk
Copy link
Contributor

eholk commented May 19, 2017

@lukewagner, is the idea that rethrow would bubble up to the next try block? For example,

(try // 2
  (block // 1
     (try // 0
        (catch
            (rethrow 1)))))

would be equivalent to (rethrow 2)?

@lukewagner
Copy link
Member Author

I was imagining that the stack being indexed would only contain try blocks, so in your example the only valid indices to rethrow would be 0 and 1. Really, the difference seems pretty minor either way; I was just asking in case anyone else was thinking the same thing or had a more substantial reason.

@lukewagner
Copy link
Member Author

Thinking about it more, since try blocks are also normal control flow blocks (for the purposes of branching), it seems like any producer would already need to be tracking them in the control flow stack and so using a normal block label does seem appropriate.

ioannad pushed a commit to ioannad/exception-handling that referenced this issue Jun 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants