[js-api] A mutable global import allocates a const global before LinkError
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 58/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- wasm
- 領域
- compilers
調査の方向性
Start with the JS API “read the imports” algorithm and trace its interaction with module_instantiate and global_alloc; compare it with the old ExecuteModule path described in the issue. Done means mismatched mutable/const global imports throw LinkError before allocation, while successful fresh-value allocation uses the import mutability.
索引モデルが issue の本文から書いたものです。
説明
In read the imports, a global import ignores mut:
If externtype is of the form global mut valtype,
If v implements Global,
Let globaladdr be v.[[Global]].
Otherwise,
…
Let (store, globaladdr) be global_alloc(store, const valtype, value).
Set the surrounding agent's associated store to store.
module_instantiate still rejects a mismatch, so the link fails. The store update happens first.
- A
varimport whose value is not aGlobalallocates aconstglobal, then the type check fails. That global stays in the store and is not exposed to JavaScript. - A
constimport of avarGlobalreuses that global and fails the same check. Nothing new is allocated.
A number can only successfully import a const global, so the allocation on the var path is always discarded.
This showed up while sharing the reader with ESM integration (discussion). The old ExecuteModule path threw LinkError before allocation when mut was var and the value was not a Global, and when a const import was a var Global. Matching the JS API drops those checks.
Suggested change, before global_alloc:
- If the value is not a
Globalandmutisvar, throw aLinkError. - If the value is a
Global,mutisconst, and that global isvar, throw aLinkError. - Otherwise allocate with the import's
mut. For a fresh value that is onlyconst.
- 主要言語
- WebAssembly
- スター
- 3.5k
- フォーク
- 539
- 平均マージ
- 10時間 24分
- マージ済み PR(30日)
- 11
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
WebAssembly/spec のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 54/100
WebAssembly/spec#2265 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
WebAssembly/spec#2258 · コメント 4 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[spectec] Wasm 1.0: `$instantiate` missing premises対応中かも @rossberg が 27 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
WebAssembly/spec#2245 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
WebAssembly/spec#2235 · コメント 9 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
WebAssembly/spec#2196 ·
メンテナーはふだん 1 日以内に返信
WebAssembly/spec の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
I-prioritize needs-triage regression-from-stable-to-beta T-lang
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
rust-lang/rust#163830 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Swift route tables omit digit constraints from generated main and tests対応中かも @dchuk が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
rubys/roundhouse#444 ·
メンテナーはふだん 1 日以内に返信
-
IntrinsicLowering::LowerCTPOP runs into assertion with LLVM 23対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンcrash llvm:codegen
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
llvm/llvm-project#229064 ·
メンテナーはふだん 1 日以内に返信
-
area:lowering kind:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信