WebAssembly / WebAssembly/wabt

Incorrect Type Index Validation for Implicit Function Signatures

Open
#2,709 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
8.1k
Forks
827
Avg merge
4d 6h
Merged PRs (30d)
18

Description

Test case

typesection3.wasm.txt

Environment
  • OS: Ubuntu 20.04
  • CPU: amd64
  • wasm-interp version: 6ca912cf
  • Commands:
wabt/bin/wasm-interp --enable-all test.wasm --run-export=run
Actual behavior

The tool fails to compile the module, reporting a type variable range error during the function definition phase:

0000024: error: function type variable out of range: 2 (max 2)
0000024: error: OnFunction callback failed
Expected behavior

The module should be accepted and compiled successfully.

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

Reproduce the failure with the attached typesection3.wasm.txt using the provided wasm-interp command. Trace validation of implicit function signatures and type-index bounds, then verify that the module is accepted and compiles successfully without the reported range error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.