[js-api] A mutable global import allocates a const global before LinkError
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 58/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- wasm
- Ambito
- compilers
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- WebAssembly
- Stelle
- 3.5k
- Fork
- 539
- Merge medio
- 10h 24m
- PR unite (30g)
- 11
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di WebAssembly/spec
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
WebAssembly/spec#2265 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
WebAssembly/spec#2258 · 4 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[spectec] Wasm 1.0: `$instantiate` missing premisesForse già presa @rossberg l’ha presa 27 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
WebAssembly/spec#2245 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
WebAssembly/spec#2235 · 9 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
WebAssembly/spec#2196 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di WebAssembly/spec
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
I-prioritize needs-triage regression-from-stable-to-beta T-lang
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
rust-lang/rust#163830 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Swift route tables omit digit constraints from generated main and testsForse già presa @dchuk l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
rubys/roundhouse#444 ·
I maintainer di solito rispondono entro 1 giorno
-
IntrinsicLowering::LowerCTPOP runs into assertion with LLVM 23Forse già presa Una pull request collegata a questa issue è aperta o già unita. Apertacrash llvm:codegen
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
llvm/llvm-project#229064 ·
I maintainer di solito rispondono entro 1 giorno
-
area:lowering kind:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno