Soundness: short-circuit RHS assignments are treated as executed
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Java
- Stelle
- 67
- Fork
- 36
- Merge medio
- 4g 17h
- PR unite (30g)
- 7
Preparare l'ambiente
- Nessun Dockerfile né 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 liquid-java/liquidjava
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
liquid-java/liquidjava#321 ·
I maintainer di solito rispondono entro 2 giorni
-
Soundness: a field of another class or object is read as this class's field with the same nameApertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
liquid-java/liquidjava#322 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
liquid-java/liquidjava#318 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
liquid-java/liquidjava#317 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 62/100
liquid-java/liquidjava#316 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di liquid-java/liquidjava
Issue simili
-
Update license yearAperta0 - Backlog 1 - Ready documentation good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
cbor
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
FasterXML/jackson-dataformats-binary#844 ·
I maintainer di solito rispondono entro 1 giorno
-
Issue: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
OpenAPITools/openapi-generator#25107 ·
I maintainer di solito rispondono entro 1 giorno
-
improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/iceberg#18351 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
repowise-dev/repowise#2945 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno