C++: Address review comments.

This commit is contained in:
Michael Nebel
2025-09-04 12:44:51 +02:00
parent 83d53baf82
commit 61e8ad264f
6 changed files with 30 additions and 15 deletions

View File

@@ -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
)
}
}

View 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.