Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Reference types crash wasm-opt‘s asyncify pass

Open
#3,739 24 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
wasm
Domain
compilers

Research direction

Reproduce the crash with wat2wasm using --enable-reference-types, then run wasm-opt with --asyncify on the generated test.wasm. Start by investigating the asyncify pass and the wasm-type.cpp failure shown in the report. Done means wasm-opt no longer aborts on this module and produces valid output.

Written by the indexing model from the issue text.

Description

(module
  (type (;0;) (func))
  (type (;1;) (func (result externref)))
  (import "gl" "createProgram" (func $src/asc/gl/createProgram (type 1)))
  (func $src/asc/lemonsoda/init (type 0)
    call $src/asc/gl/createProgram
    drop
  )
  (export "init" (func $src/asc/lemonsoda/init))
)
$ wat2wasm --enable-reference-types test.wat -o test.wasm
$ wasm-opt --asyncify --enable-reference-types test.wasm -o test2.wasm
invalid type
UNREACHABLE executed at /tmp/binaryen-20210320-71286-1g5tfwr/binaryen-version_100/src/wasm/wasm-type.cpp:488!
[1]    56081 abort      wasm-opt --asyncify --enable-reference-types test.wasm -o test2.wasm
Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
2d 4h
Merged PRs (30d)
77

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.

More from WebAssembly/binaryen

All issues in WebAssembly/binaryen

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.