Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

il2al: host function rules become two independent conditionals and ignore the new store `s'`

Aperta
#2,279 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
ocaml, wasm
Ambito
compilers

Direzione di ricerca

The two host-function rules are in spectec/specification/wasm-3.0/4.3-execution.instructions.spectec around lines 184-198. The translation that emits Either only for condition-free rules is in spectec/src/il2al/translate.ml near line 1155, so start there and compare with how memory.grow is handled. Done means the RES and BOT cases become mutually exclusive alternatives, and the store s' from the RES case is applied, as checked by the --prose output.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I came across this while looking at how il2al uses Either for nondeterminism.

The rules Step/call_ref-hostfunc-res and -div (added in #2210) can both apply:

https://github.com/WebAssembly/spec/blob/8d6a3afa965a28e145110445101338bed947991b/specification/wasm-3.0/4.3-execution.instructions.spectec#L184-L198

--prose gives:

13. If an element of $hostcall((_HOSTFUNC hf), s, val^n) is some RES, then:
  a. Let (RES s' result) be an element of $hostcall((_HOSTFUNC hf), s, val^n).
  b. Execute the sequence $lift_result(result).
14. If BOT is contained in $hostcall((_HOSTFUNC hf), s, val^n), then:
  ...
  1. Steps 13 and 14 are not alternatives, so when both apply the algorithm does both.
  2. s' is never used, so the store is not updated.

I would expect something like this, as for memory.grow (not sure how AL should update the whole store):

13. Either:
  a. Let (RES s' result) be an element of $hostcall((_HOSTFUNC hf), s, val^n).
  b. Update the store s to s'.
  c. Execute the sequence $lift_result(result).
14. Or:
  ...

It seems il2al produces Either only for rules without conditions (translate.ml#L1155).

Note: This might be low priority since neither the document nor the reference interpreter uses this algorithm.

Lingua principale
WebAssembly
Stelle
3.5k
Fork
540
Merge medio
1g 6h
PR unite (30g)
20

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WebAssembly/spec

Tutte le issue di WebAssembly/spec

Issue simili

Altre issue su Compilers

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.