Are indices in the name section expected to be valid up front?

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

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
wasm
領域
compilers

調査の方向性

Start with the name-section tests referenced from #11 and review how SpiderMonkey parses name sections, especially before a function body is fully parsed. Compare the current tests with the specification's wording, then establish whether out-of-bounds indices are accepted and update the tests to reflect the decided rule.

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

説明

In #11 I added tests for the name section that assert things like "invalid type index 123" or "invalid label index 123 for function 1". This seemed reasonable until I went to implement it in SpiderMonkey and remembered that we have no idea how many labels a function has without parsing the full body of the function, which we do quite lazily and in parallel, which is very inconvenient for name section validation.

In principle, we don't actually need to validate all the indices in the name section. If extra names are present that don't correspond to any actual items in the module, that doesn't really hurt anyone (except perhaps the user downloading the oversize module, but they had to anyway because it's a custom section). The spec doesn't actually say today whether the indices in the name section are expected to be valid, only that the name subsections themselves are well-formed.

Basically my question is: should we just delete these valid-index tests across the board / flip them to asserting validity, or should we keep them? My preference would be to flip them all to asserting that out-of-bounds indexes are actually valid.

主要言語
WebAssembly
スター
12
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

WebAssembly/extended-name-section のほかの issue

WebAssembly/extended-name-section の issue をすべて見る

似ている issue

Compilers の issue をもっと見る

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

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