Soundness: short-circuit RHS assignments are treated as executed
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Start at RefinementTypeChecker.visitCtBinaryOperator and reproduce the false && and true || cases from the issue. Compare current main with the conservative fix in PR #257, then verify both operators, nested writes, and branches where the RHS runs or is skipped. Done means the invalid refinement is rejected without rejecting valid executed-RHS cases.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
A write in the right operand of Java && or || is applied to LiquidJava's variable context even when Java short-circuits and does not execute that operand. The verifier can then prove a refinement about a value the program never assigned.
Minimal reproducer
import liquidjava.specification.Refinement;
public class Repro {
public static void main(String[] args) {
int x = 0;
boolean ignored = false && ((x = 1) == 1);
@Refinement("_ == 1") int y = x; // should be a Refinement Error
assert y == 1; // fails: y is 0
}
}
Expected: Reject the refinement on y. Java skips the RHS of &&, so x remains 0.
Actual: Correct! Passed Verification. on main at dd02e996. Compiling and running the program with assertions enabled throws AssertionError. The analogous true || RHS path has the same conditional-execution rule.
Cause and scope
RefinementTypeChecker.visitCtBinaryOperator scans both operands before applying the binary operation refinement. A RHS assignment updates the context during that scan; the later operator check does not distinguish a definitely executed write from a conditionally executed one.
The closed PR #257 contains a reproducer and a conservative fix. The fix should be ported and reviewed against current main, including both operators, nested writes, and branches where the RHS runs or is skipped. Example tests now use // Expect: Refinement Error after #293.
- Lenguaje dominante
- Java
- Estrellas
- 67
- Forks
- 36
- Merge medio
- 4 d 17 h
- PR fusionados (30 d)
- 7
Preparar el entorno
- Sin Dockerfile ni 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 liquid-java/liquidjava
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
liquid-java/liquidjava#321 ·
Los mantenedores suelen responder en 2 días
-
Soundness: a field of another class or object is read as this class's field with the same nameAbiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 76/100
liquid-java/liquidjava#322 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
liquid-java/liquidjava#318 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
liquid-java/liquidjava#317 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 62/100
liquid-java/liquidjava#316 ·
Los mantenedores suelen responder en 2 días
Todos los issues de liquid-java/liquidjava
Issues similares
-
Update license yearAbierto0 - Backlog 1 - Ready documentation good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
cbor
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
FasterXML/jackson-dataformats-binary#844 ·
Los mantenedores suelen responder en 1 día
-
improvement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/iceberg#18351 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
repowise-dev/repowise#2945 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Interpolating settings.xml can lead to malformed XML when variable value contains double-hyphenAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
apache/maven#13321 · 1 comentario ·
Los mantenedores suelen responder en 1 día