new T[a][b] gets length b instead of a (unsound)
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Java
- スター
- 73
- フォーク
- 38
- 平均マージ
- 12時間 32分
- マージ済み PR(30日)
- 45
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
liquid-java/liquidjava のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
liquid-java/liquidjava#562 ·
メンテナーはふだん 1 日以内に返信
-
A float ghost crashes the verifier: "Ghost not implemented for type float"対応中かも @MohammedZaid1740 が 7 日前に担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
liquid-java/liquidjava#443 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug real-world-finding
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
liquid-java/liquidjava#395 ·
メンテナーはふだん 1 日以内に返信
-
A ternary between arrays crashes: Sorts (Array Int Int) and Bool are incompatible対応中かも @CatarinaGamboa が 4 日前に担当しました。 オープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
liquid-java/liquidjava#558 ·
メンテナーはふだん 1 日以内に返信
-
Invariant inference: mark inferred facts in diagnostics, and a hint to state a loop invariant対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンenhancement error messages
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
liquid-java/liquidjava#554 ·
メンテナーはふだん 1 日以内に返信
liquid-java/liquidjava の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
avaje/avaje-metrics#139 ·
-
documentation good first issue help wanted
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
Attachment upload accepts a file part with no file chosen and stores an empty comp_attachment対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
eclipse-sw360/sw360#4849 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
exoego/keycloak-fuhito#888 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Skip cross-field checkpointing validation rules when checkpointing is disabled対応中かも @hutiefang76 が今日担当しました。 オープンaccepted bug good first issue java
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Sekelenao/Flinkboot#473 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信