Skip to content

Commit febc82d

Browse files
committed
Merge branch 'UncheckedLeaprYearAfterModification_Refactor_Upstream' of https://github.com/microsoft/codeql into UncheckedLeaprYearAfterModification_Refactor_Upstream
2 parents 4a7395b + 9bbbbef commit febc82d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ class IgnorableExpr10MultipleComponent extends IgnorableOperation {
106106
}
107107

108108
/**
109-
* An operation involving a sub expression with char literal 48, ignore as a likely string conversion
110-
* e.g., X - '0'
109+
* An operation involving a sub expression with char literal `48`, ignore as a likely string conversion. For example: `X - '0'`
111110
*/
112111
class IgnorableExpr48Mapping extends IgnorableOperation {
113112
IgnorableExpr48Mapping() {
@@ -208,7 +207,7 @@ class OperationAsArgToIgnorableFunction extends IgnorableOperation {
208207
}
209208

210209
/**
211-
* A Literal OP literal means the result is constant/known
210+
* A binary operation on two literals means the result is constant/known
212211
* and the operation is basically ignorable (it's not a real operation but
213212
* probably one visual simplicity what it means).
214213
*/
@@ -264,7 +263,7 @@ class IgnorablePointerOrCharArithmetic extends IgnorableOperation {
264263
}
265264

266265
/**
267-
* Holds for an expression that is a operation that could flow to a Year field.
266+
* Holds for an expression that is an add or similar operation that could flow to a Year field.
268267
*/
269268
predicate isOperationSourceCandidate(Expr e) {
270269
not e instanceof IgnorableOperation and
@@ -286,7 +285,7 @@ predicate isOperationSourceCandidate(Expr e) {
286285
}
287286

288287
/**
289-
* A dataflow that tracks an ignorable operation (eg. bitwise op) to a operation source, so we may disqualify it.
288+
* A data flow that tracks an ignorable operation (such as a bitwise operation) to an operation source, so we may disqualify it.
290289
*/
291290
module IgnorableOperationToOperationSourceCandidateConfig implements DataFlow::ConfigSig {
292291
predicate isSource(DataFlow::Node n) { n.asExpr() instanceof IgnorableOperation }
@@ -352,7 +351,7 @@ class YearFieldAssignmentNode extends DataFlow::Node {
352351
}
353352

354353
/**
355-
* A DataFlow configuration for identifying flows from some non trivial access or literal
354+
* A DataFlow configuration for identifying flows from an identified source
356355
* to the Year field of a date object.
357356
*/
358357
module OperationToYearAssignmentConfig implements DataFlow::ConfigSig {

0 commit comments

Comments
 (0)