Skip to content

Commit 59964bd

Browse files
authored
Merge pull request #1575 from jbj/UncheckedLeapYear-bb
C++: Fix performance of unchecked leap year query
2 parents 66464b5 + 21c6340 commit 59964bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ where
2424
exists(LeapYearFieldAccess yfacheck |
2525
yfacheck.getQualifier() = var.getAnAccess() and
2626
yfacheck.isUsedInCorrectLeapYearCheck() and
27-
yfacheck = yfa.getASuccessor*()
27+
yfacheck.getBasicBlock() = yfa.getBasicBlock().getASuccessor*()
2828
)
2929
or
3030
// If there is a data flow from the variable that was modified to a function that seems to check for leap year
@@ -50,8 +50,8 @@ where
5050
mfa.getQualifier() = var.getAnAccess() and
5151
mfa.isModified() and
5252
(
53-
mfa = yfa.getASuccessor*() or
54-
yfa = mfa.getASuccessor*()
53+
mfa.getBasicBlock() = yfa.getBasicBlock().getASuccessor*() or
54+
yfa.getBasicBlock() = mfa.getBasicBlock().getASuccessor+()
5555
) and
5656
ae = mfa.getEnclosingElement() and
5757
ae.getAnOperand().getValue().toInt() = 1

0 commit comments

Comments
 (0)