Skip to content

Commit ce802bd

Browse files
committed
More ignorable functions, and adding 0 as an ignorable constant.
1 parent b013012 commit ce802bd

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModificationPrecise.ql

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ class IgnorableFunction extends Function {
2121
IgnorableFunction() {
2222
// Helper utility in postgres with string time conversions
2323
this.getName() = "DecodeISO8601Interval"
24+
or
25+
// helper utility for date conversions in qtbase
26+
this.getName() = "adjacentDay"
27+
or
28+
// Windows API function that does timezone conversions
29+
this.getName().matches("%SystemTimeToTzSpecificLocalTime%")
30+
or
31+
// Windows APIs that do time conversions
32+
this.getName().matches("%localtime%\\_s%")
33+
or
34+
// Windows APIs that do time conversions
35+
this.getName().matches("%SpecificLocalTimeToSystemTime%")
2436
}
2537
}
2638

@@ -74,6 +86,8 @@ class IgnorableCharLiteralArithmetic extends IgnorableOperation {
7486
bindingset[c]
7587
predicate isLikelyConversionConstant(int c) {
7688
exists(int i | i = c.abs() | i >= 100)
89+
or
90+
c = 0
7791
// c = 146097 or // days in 400-year Gregorian cycle
7892
// c = 36524 or // days in 100-year Gregorian subcycle
7993
// c = 1461 or // days in 4-year cycle (incl. 1 leap)

0 commit comments

Comments
 (0)