github / github/codeql

Java: `ArrayInit.getInit` has indices < 0 for annotations

Open
#8,645 3 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
CodeQL
Stars
10.1k
Forks
2.1k
Avg merge
2d 15h
Merged PRs (30d)
141

Description

### Version
CodeQL CLI version: 2.8.4

### Description of the issue

For array inits as part of annotations CodeQL's `ArrayInit.getInit` erroneously has `index` values < 0 as result.

### Example query
```ql
import java

from ArrayInit init, int index, Expr e
where
init.getInit(index) = e
and index < 0
select init, index, e
```
[Query Console link](https://lgtm.com/query/6322278065984969890/)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.