lib/eigen.eigs lexes "\r" as "r": under eigen_run, "a\rb" == "arb" is true (the VM says false)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 88/100
Direzione di ricerca
Leggi gli switch di escape alle righe 324-337 e 413-422 in lib/eigen.eigs, poi confrontali con src/lexer.c:565 e :696. Aggiungi copertura alla suite seguendo lo stile di tests/test_meta_fstr_host_str.eigs ed esegui questi controlli per le stringhe normali e le f-string rispetto alla VM. Il lavoro è completato quando entrambe le forme decodificano \r come ritorno a capo e corrispondono alla VM.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Found while root-causing an EigenRegex probe for InauguralSystems/EigenRegex#37, on the v0.46.0 release binary. lib/eigen.eigs is the same blob (bb721a65) on v0.46.0 and on main 5a7b703e.
Repro
import eigen
print of ("a\rb" == "arb")
print of (eigen.eigen_run of "\"a\\rb\" == \"arb\"")
print of (eigen.eigen_run of "f\"a\\rb\" == \"arb\"")
This prints false, true, true and exits 0. The VM decodes \r to a carriage return. The meta-interpreter decodes it to the letter r, in plain strings and in f-strings. The file's header promises evaluator values at parity with the C evaluator.
Root cause
Neither escape switch in lib/eigen.eigs has an r arm, so \r falls into the catch-all buf is buf + esc. The f-string switch is at lines 324-337 and the plain-string switch at lines 413-422. src/lexer.c:565 (f-strings) and :696 (plain strings) decode \r to CR. ouroboros had the same gap and fixed it in src/frontend.eigs:237-246, where the bootstrap fixed point caught it. This copy never got that fix.
Done when
- Both escape switches in
lib/eigen.eigsdecode\rto CR, assrc/lexer.c:565and:696do. - A suite test in the style of
tests/test_meta_fstr_host_str.eigscompareseigen_runwith the VM on both forms:
On v0.46.0 both checks fail, givingcheck of ["meta plain string decodes the r escape like the VM", eigen.eigen_run of "\"a\\rb\" == \"arb\"", "a\rb" == "arb"] check of ["meta f-string decodes the r escape like the VM", eigen.eigen_run of "f\"a\\rb\" == \"arb\"", f"a\rb" == "arb"]truewhere the VM givesfalse. With the two missing arms added to a scratch copy oflib/eigen.eigs, both pass.
Out of scope here: unknown escapes (\q, \0, \u212a) silently dropping the backslash in all three lexers is #1641.
- Lingua principale
- C
- Stelle
- 3
- Fork
- 7
- Merge medio
- 11h 40m
- PR unite (30g)
- 270
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un 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 InauguralSystems/EigenScript
-
area:docs kind:docs-drift
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
InauguralSystems/EigenScript#1887 ·
I maintainer di solito rispondono entro 1 giorno
-
phase2: test_bitwise.eigs cites ctl.scan.* rows; the MAP's refusal controls are ctl.N8.refuse-*Apertaarea:gates kind:docs-drift
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
InauguralSystems/EigenScript#1851 ·
I maintainer di solito rispondono entro 1 giorno
-
area:gates area:gfx found-by:critic kind:gate-defect
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
InauguralSystems/EigenScript#1825 ·
I maintainer di solito rispondono entro 1 giorno
-
UB: (int) cast of a user double outside int range in dispatch / vm_index_is_int / flat_index_atApertaarea:runtime-vm kind:silent-wrong
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
InauguralSystems/EigenScript#1748 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:gfx bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
InauguralSystems/EigenScript#1684 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di InauguralSystems/EigenScript
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
valkey-io/valkey#4979 · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
colbymchenry/codegraph#2770 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
OpenCyphal/libcanard#264 ·
-
area/ysql kind/enhancement priority/medium status/awaiting-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
yugabyte/yugabyte-db#35578 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno