lib/eigen.eigs lexes "\r" as "r": under eigen_run, "a\rb" == "arb" is true (the VM says false)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 88/100
Línea de trabajo
Lee los interruptores de escape en las líneas 324-337 y 413-422 de lib/eigen.eigs y compáralos con src/lexer.c:565 y :696. Añade cobertura a la suite siguiendo el estilo de tests/test_meta_fstr_host_str.eigs y ejecuta esas comprobaciones para cadenas normales y f-strings frente a la VM. Se considera terminado cuando ambas formas decodifican \r como un retorno de carro y coinciden con la VM.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C
- Estrellas
- 3
- Forks
- 7
- Merge medio
- 11 h 40 min
- PR fusionados (30 d)
- 270
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de InauguralSystems/EigenScript
-
area:docs kind:docs-drift
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
InauguralSystems/EigenScript#1887 ·
Los mantenedores suelen responder en 1 día
-
phase2: test_bitwise.eigs cites ctl.scan.* rows; the MAP's refusal controls are ctl.N8.refuse-*Abiertoarea:gates kind:docs-drift
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
InauguralSystems/EigenScript#1851 ·
Los mantenedores suelen responder en 1 día
-
area:gates area:gfx found-by:critic kind:gate-defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
InauguralSystems/EigenScript#1825 ·
Los mantenedores suelen responder en 1 día
-
UB: (int) cast of a user double outside int range in dispatch / vm_index_is_int / flat_index_atAbiertoarea:runtime-vm kind:silent-wrong
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
InauguralSystems/EigenScript#1748 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area:gfx bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
InauguralSystems/EigenScript#1684 ·
Los mantenedores suelen responder en 1 día
Todos los issues de InauguralSystems/EigenScript
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
sumatrapdfreader/sumatrapdf#6403 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
followup
Dificultad 1/5 Menos de una hora Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
bytecodealliance/StarlingMonkey#343 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
oetiker/rrdtool-1.x#1392 ·