new T[a][b] gets length b instead of a (unsound)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Java
- Star
- 73
- Fork
- 38
- Merge trung bình
- 12 giờ 32 phút
- Pull request đã merge (30 ngày)
- 45
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của liquid-java/liquidjava
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
liquid-java/liquidjava#562 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A float ghost crashes the verifier: "Ghost not implemented for type float"Có thể đã có người làm @MohammedZaid1740 đã nhận 7 ngày trước. Đang mởbug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
liquid-java/liquidjava#443 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug real-world-finding
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
liquid-java/liquidjava#395 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A ternary between arrays crashes: Sorts (Array Int Int) and Bool are incompatibleCó thể đã có người làm @CatarinaGamboa đã nhận 4 ngày trước. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
liquid-java/liquidjava#558 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Invariant inference: mark inferred facts in diagnostics, and a hint to state a loop invariantCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởenhancement error messages
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
liquid-java/liquidjava#554 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của liquid-java/liquidjava
Issue tương tự
-
missing Git commit for 10.5-RC1Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
avaje/avaje-metrics#139 ·
-
documentation good first issue help wanted
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Attachment upload accepts a file part with no file chosen and stores an empty comp_attachmentCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
eclipse-sw360/sw360#4849 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
exoego/keycloak-fuhito#888 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Skip cross-field checkpointing validation rules when checkpointing is disabledCó thể đã có người làm @hutiefang76 đã nhận hôm nay. Đang mởaccepted bug good first issue java
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Sekelenao/Flinkboot#473 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày