WebAssembly / WebAssembly/binaryen
Using two reloopers in one function can cause block name collisions.
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 69
Description
I am writing a WebAssembly compiler backing for the V programming language using binaryen.
I use reloopers/CFG to generate if statements, there can be many in one function. With only two if statements corresponding to two invokes of a relooper, validation fails with this error message below.
[wasm-validator error in function main.powi] unexpected false: names in Binaryen IR must be unique - IR generators must ensure that, on
block$3$break
Is there a way to make all relooper blocks unique? I am using the C API, which AFAIK does not have ways to solve this.
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 by tracing the reloopers/CFG path and its C API entry points, then reproduce the failure with two relooper invocations in one function. Check how Binaryen IR assigns block names and run the WebAssembly validator; done means the generated blocks have unique names and validation succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, wasm
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100