Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[interpreter] Binary decoder rejects heap type indices >= 2^31 as malformed

オープン
#2,289 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@rossberg がすでに取り組んでいます。

2026年10月21日 から。

  • #2294 @rossberg による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
67/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
wasm

調査の方向性

Start in interpreter/binary/decode.ml at the s33 decoding path around line 108, then compare how it handles the provided boundary indices 2^31 and 2^31 - 1. Run the interpreter against the included assert_invalid module and check the reported error. Done means 2^31 is decoded as a well-formed index and the module reports "unknown type" rather than "integer representation too long".

索引モデルが issue の本文から書いたものです。

説明

A heap type index is any non-negative s33:

https://github.com/WebAssembly/spec/blob/340650f2f620169685814774bc5b019d05d4d3d7/specification/wasm-3.0/5.2-binary.types.spectec#L30-L32

So an index of 2^31 or 2^32 - 1 is well-formed, and a module using it is invalid (unknown type), not malformed. The decoder wraps the s33 to a signed 32-bit integer first and reports "integer representation too long":

https://github.com/WebAssembly/spec/blob/340650f2f620169685814774bc5b019d05d4d3d7/interpreter/binary/decode.ml#L108

;; (type (func (param (ref null 2147483648))))
(assert_invalid
  (module binary "\00asm" "\01\00\00\00"
    "\01\0a\01\60\01\63\80\80\80\80\08\00")
  "unknown type")

The interpreter fails this with integer representation too long. Index 2^31 - 1 (\ff\ff\ff\ff\07) is reported as "unknown type" as expected.

Tested at 340650f.

主要言語
WebAssembly
スター
3.5k
フォーク
540
平均マージ
1日 4時間
マージ済み PR(30日)
19

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

WebAssembly/spec のほかの issue

WebAssembly/spec の issue をすべて見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。