new T[a][b] gets length b instead of a (unsound)
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 30/100
Direção de pesquisa
The bug is in RefinementTypeChecker.visitCtNewArray, which loops over the dimension expressions and keeps the last one, where it should keep the first. Start there and read the TODO about only working for one dimension. Done means length(_) of new int[2][3] resolves to 2, and the reproducer in the issue is rejected. Open pull request #559 already targets this, so check it before starting.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Description
A multi-dimensional array creation gets the length of its last dimension instead of its first, so wrong programs are accepted (unsound).
Minimal reproducer
import liquidjava.specification.Refinement;
public class Grid {
static void rows(int[][] g, @Refinement("_ == length(g)") int n) {}
public static void main(String[] args) {
rows(new int[2][3], 3); // length(g) is 2, should be rejected
}
}
Result on main: Correct! Passed Verification.
Cause
RefinementTypeChecker.visitCtNewArray loops over the dimension expressions and keeps the last one (there is a "only working for 1 dimension" TODO there).
Expected
length(_) of new T[d1][d2]... is d1. Inner arrays are not modelled, so nothing should be assumed about them. Found while reviewing #540.
- 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
-
Invariant inference: mark inferred facts in diagnostics, and a hint to state a loop invariantTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertaenhancement error messages
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
liquid-java/liquidjava#554 ·
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 65/100
avaje/avaje-metrics#139 ·
-
documentation good first issue help wanted
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
-
Attachment upload accepts a file part with no file chosen and stores an empty comp_attachmentTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
eclipse-sw360/sw360#4849 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
exoego/keycloak-fuhito#888 ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: Skip cross-field checkpointing validation rules when checkpointing is disabledTalvez já em andamento @hutiefang76 assumiu hoje. Abertaaccepted bug good first issue java
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Sekelenao/Flinkboot#473 · 1 comentário ·
Mantenedores costumam responder em até 1 dia