Java: Comparing Location leads to incorrect results
- 主要語言
- CodeQL
- 星號
- 10.1k
- 分支
- 2.1k
- 平均合併
- 2 天 15 小時
- 30 天內合併 PR
- 141
描述
**Description of the issue**
It appears when comparing `Location` of two different elements non-existent or incorrect results are found.
Try the query below on the default projects on https://lgtm.com/query:
```
import java
from ArrayTypeAccess arrayTypeAccess, Location location, RValue other, Location otherLocation
where
arrayTypeAccess.getFile() = other.getFile()
and location = arrayTypeAccess.getLocation()
and otherLocation = other.getLocation()
and location.getStartLine() = otherLocation.getStartLine()
and location.getEndLine() = otherLocation.getEndLine()
and location.getStartColumn() = otherLocation.getStartColumn()
and location.getEndColumn() = otherLocation.getEndColumn()
select arrayTypeAccess, other
```
It finds ArrayTypeAccess' where there are none and also finds RValues of variables which do not exist at that position.
貢獻指南
評估
這個 Issue 還沒有評估資料。