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

wasm-decompile: Assertion `is_name()' failed. #2304

Open
nepx opened this issue Sep 26, 2023 · 1 comment
Open

wasm-decompile: Assertion `is_name()' failed. #2304

nepx opened this issue Sep 26, 2023 · 1 comment

Comments

@nepx
Copy link

nepx commented Sep 26, 2023

wasm-decompile crashes when trying to process this WAT file. Interestingly enough, it works after being processed with wasm-opt.

The full text of the error is:

wabt-main/include/wabt/ir.h:62: const string& wabt::Var::name() const: Assertion `is_name()' failed.
@keithw
Copy link
Member

keithw commented Oct 5, 2023

I think the root issue here is that wasm-decompile doesn't know how to handle a br to the implicit function label, which is basically equivalent to a return. My guess is that wasm-opt is converting this to a return, which wasm-decompile does know how to handle.

Here's a minimal test case that also triggers the same assertion failure:

(func br 0)

Handling this cleanly is probably pretty doable but requires some mucking with the decompiler.

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

No branches or pull requests

3 participants