Soundness: a field write through another object of the same class (`o.x = 5`) is applied to `this.x`
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 66/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- java
- Domínio
- testing-qa
Direção de pesquisa
Start with RefinementTypeChecker.visitAssignment at RefinementTypeChecker.java:255-258 and compare its field write handling with visitCtFieldRead and Utils.accessesTrackedField, which the issue says handles reads. Use the minimal Repro example to check the current result and the control without the write. Done when the same-class write no longer makes verification incorrectly pass and the expected refinement error is reported.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Impact: a real violation passes verification (missed error).
Description
A field write through another object of the same class (o.x = 5) is recorded as a write to this.x. RefinementTypeChecker.visitAssignment (RefinementTypeChecker.java:255-258) names every CtFieldWrite with Utils.qualifyFieldName, whatever its target. #322 fixed this for reads (visitCtFieldRead checks Utils.accessesTrackedField); this is the write side. Writes to a field of another class (a.x = 5 with A a) and reads of o.x are handled correctly. A write whose target is not this could skip the update of this.x, or havoc it since o may be this.
Minimal reproducer
import liquidjava.specification.Refinement;
public class Repro {
int x;
void m(Repro o) {
o.x = 5;
@Refinement("_ == 5") int k = this.x; // this.x is unknown
}
}
Expected
A Refinement Error at k (this.x may be anything).
Actual
Correct! Passed Verification.
Control: without o.x = 5
Refinement Error: k¹ == x is not a subtype of k¹ == 5
Not a duplicate of #340: that one is about a field's initializer being assumed in another method; here the value comes from a write to a different object in the same method.
Reproduced on main at 1a506fea (liquidjava-verifier 0.0.36).
Context
Found while reviewing #432. Related: #322.
🤖 Generated with Claude Code
- Linguagem predominante
- Java
- Estrelas
- 73
- Forks
- 38
- Merge médio
- 12h 32min
- PRs com merge (30d)
- 45
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de liquid-java/liquidjava
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
liquid-java/liquidjava#562 ·
Mantenedores costumam responder em até 1 dia
-
A float ghost crashes the verifier: "Ghost not implemented for type float"Talvez já em andamento @MohammedZaid1740 assumiu há 7 dias. Abertabug good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
liquid-java/liquidjava#443 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug real-world-finding
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
liquid-java/liquidjava#395 ·
Mantenedores costumam responder em até 1 dia
-
A ternary between arrays crashes: Sorts (Array Int Int) and Bool are incompatibleTalvez já em andamento @CatarinaGamboa assumiu há 4 dias. Abertabug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 15/100
liquid-java/liquidjava#558 ·
Mantenedores costumam responder em até 1 dia
-
new T[a][b] gets length b instead of a (unsound)Talvez já em andamento @CatarinaGamboa assumiu há 4 dias. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 30/100
liquid-java/liquidjava#557 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de liquid-java/liquidjava
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 60/100
quelea-projection/Quelea#749 ·
Mantenedores costumam responder em até 1 dia
-
free_port can hand one port to two callers, so the fixed-port http tests fail in parallel runsAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 92/100
erkamyaman/rust-anything#963 ·
Mantenedores costumam responder em até 1 dia
-
api-diagnostics bug jdbc
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
ClickHouse/clickhouse-java#3464 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 Meio dia Facilidade para iniciantes 76/100
-
Deferred
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Sanne/incus-spawn#2768 ·
Mantenedores costumam responder em até 1 dia