Skip to content

Commit 4f9dc4b

Browse files
committed
C++: LeapYear
1 parent 1dc93ac commit 4f9dc4b

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

cpp/ql/src/Likely Bugs/Leap Year/LeapYear.qll

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,7 @@ private module LeapYearCheckConfig implements DataFlow::ConfigSig {
217217
}
218218

219219
predicate observeDiffInformedIncrementalMode() {
220-
any() // TODO: Make sure that the location overrides match the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 34 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@57:8:57:10), Column 1 does not select a source or sink originating from the flow call on line 41 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@57:8:57:10), Column 3 does not select a source or sink originating from the flow call on line 34 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@59:3:59:17), Column 3 does not select a source or sink originating from the flow call on line 41 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@59:3:59:17), Column 5 does not select a source or sink originating from the flow call on line 34 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@59:48:59:50), Column 5 does not select a source or sink originating from the flow call on line 41 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@59:48:59:50)
221-
}
222-
223-
Location getASelectedSourceLocation(DataFlow::Node source) {
224-
none() // TODO: Make sure that this source location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 34 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@57:8:57:10), Column 1 does not select a source or sink originating from the flow call on line 41 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@57:8:57:10), Column 3 does not select a source or sink originating from the flow call on line 34 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@59:3:59:17), Column 3 does not select a source or sink originating from the flow call on line 41 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@59:3:59:17), Column 5 does not select a source or sink originating from the flow call on line 34 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@59:48:59:50), Column 5 does not select a source or sink originating from the flow call on line 41 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@59:48:59:50)
225-
}
226-
227-
Location getASelectedSinkLocation(DataFlow::Node sink) {
228-
none() // TODO: Make sure that this sink location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 34 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@57:8:57:10), Column 1 does not select a source or sink originating from the flow call on line 41 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@57:8:57:10), Column 3 does not select a source or sink originating from the flow call on line 34 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@59:3:59:17), Column 3 does not select a source or sink originating from the flow call on line 41 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@59:3:59:17), Column 5 does not select a source or sink originating from the flow call on line 34 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@59:48:59:50), Column 5 does not select a source or sink originating from the flow call on line 41 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql@59:48:59:50)
220+
none() // only used negatively in UncheckedLeapYearAfterYearModification.ql
229221
}
230222
}
231223

@@ -299,6 +291,12 @@ private module PossibleYearArithmeticOperationCheckConfig implements DataFlow::C
299291
}
300292

301293
predicate observeDiffInformedIncrementalMode() { any() }
294+
295+
Location getASelectedSourceLocation(DataFlow::Node source) {
296+
result = source.asExpr().getLocation()
297+
}
298+
299+
Location getASelectedSinkLocation(DataFlow::Node sink) { result = sink.asExpr().getLocation() }
302300
}
303301

304302
module PossibleYearArithmeticOperationCheckFlow =

0 commit comments

Comments
 (0)