WebAssembly / WebAssembly/binaryen
Asyncify produces invalid IR for inner passes
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 69
Description
In https://github.com/WebAssembly/binaryen/pull/8738#discussion_r3282670237, we found that Asyncify creates calls to functions that don't exist, and then runs some inner passes. With the code from #8738, SimplifyLocals crashes when trying to lookup a function that doesn't exist (__asyncify_get_call_index in this case). We should add these functions as imports so that passes don't need to handle invalid IR.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/passes/Asyncify.cpp at the cited call-generation code around lines 1256 and 1864-1880, then inspect how the inner passes resolve functions. Reproduce the SimplifyLocals crash involving __asyncify_get_call_index. Done means Asyncify represents these generated functions as imports so its inner passes no longer process invalid IR.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, wasm
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100