mirror of
https://github.com/github/codeql.git
synced 2026-04-22 23:35:14 +02:00
C++: Address review comments.
This commit is contained in:
@@ -15,17 +15,19 @@ import cpp
|
||||
class RangeFunction extends Function {
|
||||
/**
|
||||
* Holds if this function is at the specified location.
|
||||
* The location spans column `sc` of line `sl` to
|
||||
* column `ec` of line `el` in file `path`.
|
||||
* The location spans column `startcolumn` of line `startline` to
|
||||
* column `endcolumn` of line `endline` in file `filepath`.
|
||||
* For more information, see
|
||||
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
|
||||
*/
|
||||
predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
|
||||
super.getLocation().hasLocationInfo(path, sl, sc, _, _) and
|
||||
predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
super.getLocation().hasLocationInfo(filepath, startline, startcolumn, _, _) and
|
||||
(
|
||||
this.getBlock().getLocation().hasLocationInfo(path, _, _, el, ec)
|
||||
this.getBlock().getLocation().hasLocationInfo(filepath, _, _, endline, endcolumn)
|
||||
or
|
||||
not exists(this.getBlock()) and el = sl + 1 and ec = 1
|
||||
not exists(this.getBlock()) and endline = startline + 1 and endcolumn = 1
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
5
cpp/ql/src/change-notes/2025-09-03-rename-api.md
Normal file
5
cpp/ql/src/change-notes/2025-09-03-rename-api.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
category: fix
|
||||
---
|
||||
* The predicate `occurenceCount` in the file module `MagicConstants` has been deprecated. Use `occurrenceCount` instead.
|
||||
* The predicate `additionalAdditionOrSubstractionCheckForLeapYear` in the file module `LeapYear` has been deprecated. Use `additionalAdditionOrSubtractionCheckForLeapYear` instead.
|
||||
Reference in New Issue
Block a user