Skip to content

Commit aab59f6

Browse files
bdrodesMathiasVP
andauthored
Update cpp/ql/src/Likely Bugs/Leap Year/LeapYear.qll
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
1 parent 9205924 commit aab59f6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,14 @@ class StructTmLeapYearFieldAccess extends LeapYearFieldAccess {
362362
/**
363363
* `stDate.wMonth == 2`
364364
*/
365-
class DateCheckMonthFebruary extends Operation {
365+
private class DateCheckMonthFebruary extends EQExpr {
366+
MonthFieldAccess mfa;
367+
366368
DateCheckMonthFebruary() {
367-
this.getOperator() = "==" and
368-
this.getAnOperand() instanceof MonthFieldAccess and
369-
this.getAnOperand().(Literal).getValue() = "2"
369+
this.hasOperands(mfa, any(Literal lit | lit.getValue() = "2"))
370370
}
371371

372-
Expr getDateQualifier() { result = this.getAnOperand().(MonthFieldAccess).getQualifier() }
372+
Expr getDateQualifier() { result = mfa.getQualifier() }
373373
}
374374

375375
/**

0 commit comments

Comments
 (0)