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

[EH] --translate-to-new-eh "invalid delegate" #6274

Open
yamt opened this issue Feb 5, 2024 · 2 comments
Open

[EH] --translate-to-new-eh "invalid delegate" #6274

yamt opened this issue Feb 5, 2024 · 2 comments
Assignees

Comments

@yamt
Copy link
Contributor

yamt commented Feb 5, 2024

iiuc, delegate is allowed to target any type of block.
from the overview of the old EH proposal:

delegate can also target catch-less trys or non-try block constructs
like blocks or loops, in which case the delegated exception is assumed to
propagate to the outer scope and will be caught by the next matching
try-catches, or rethrown to the caller if there is no outer try block.

but --translate-to-new-eh complains like [parse exception: exceptionTargetNames not empty - invalid delegate (at 0:48)].

eg.

(module
  (tag)
  (func (export "main")
    block
      try
        throw 0
      delegate 0
    end
  )
)
@aheejin
Copy link
Member

aheejin commented Feb 5, 2024

This is unrelated to the new --translate-to-new-eh. Parsing of delegate targeting a block has never been supported in Binaryen. Yes it is allowed in the spec, but because our primary producer that generates delegate, LLVM's Wasm backend, does not produce such code, supporting that has not been a priority. And given that we are planning to put more efforts on supporting the new instructions and less on improving support for the old instructions, I'm not sure whether this will be supported in the near future (or more frankly, ever). May I ask which toolchain generated this code, and what's your usage for this?

@yamt
Copy link
Contributor Author

yamt commented Feb 6, 2024

This is unrelated to the new --translate-to-new-eh. Parsing of delegate targeting a block has never been supported in Binaryen.

ok

Yes it is allowed in the spec, but because our primary producer that generates delegate, LLVM's Wasm backend, does not produce such code, supporting that has not been a priority. And given that we are planning to put more efforts on supporting the new instructions and less on improving support for the old instructions, I'm not sure whether this will be supported in the near future (or more frankly, ever). May I ask which toolchain generated this code, and what's your usage for this?

i'm just experimenting things. i have no real use cases of this construct.

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