WebAssembly / WebAssembly/binaryen

Parse bug with extra non-nullable br_on_cast values

Open
#8,949 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
1d 19h
Merged PRs (30d)
69

Description

(module
  (type $s (struct))
  (func (param $s (ref $s)) (result (ref $s) (ref $s))
    local.get $s
    local.get $s
    br_on_cast 0 (ref $s) (ref $s)
  )
)
[wasm-validator error in function 0] unexpected false: non-nullable local's sets must dominate gets

Looks like we're not setting up the scratch locals quite right. It doesn't look like we're properly preserving exact results, either.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided module through Binaryen's WebAssembly validator and trace how br_on_cast handles its extra non-nullable values. Inspect the scratch-local setup and result preservation described in the report; done means the repro validates without the dominance error and preserves the exact results.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
54/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.