mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
Merge pull request #1575 from jbj/UncheckedLeapYear-bb
C++: Fix performance of unchecked leap year query
This commit is contained in:
@@ -24,7 +24,7 @@ where
|
|||||||
exists(LeapYearFieldAccess yfacheck |
|
exists(LeapYearFieldAccess yfacheck |
|
||||||
yfacheck.getQualifier() = var.getAnAccess() and
|
yfacheck.getQualifier() = var.getAnAccess() and
|
||||||
yfacheck.isUsedInCorrectLeapYearCheck() and
|
yfacheck.isUsedInCorrectLeapYearCheck() and
|
||||||
yfacheck = yfa.getASuccessor*()
|
yfacheck.getBasicBlock() = yfa.getBasicBlock().getASuccessor*()
|
||||||
)
|
)
|
||||||
or
|
or
|
||||||
// If there is a data flow from the variable that was modified to a function that seems to check for leap year
|
// 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
|
|||||||
mfa.getQualifier() = var.getAnAccess() and
|
mfa.getQualifier() = var.getAnAccess() and
|
||||||
mfa.isModified() and
|
mfa.isModified() and
|
||||||
(
|
(
|
||||||
mfa = yfa.getASuccessor*() or
|
mfa.getBasicBlock() = yfa.getBasicBlock().getASuccessor*() or
|
||||||
yfa = mfa.getASuccessor*()
|
yfa.getBasicBlock() = mfa.getBasicBlock().getASuccessor+()
|
||||||
) and
|
) and
|
||||||
ae = mfa.getEnclosingElement() and
|
ae = mfa.getEnclosingElement() and
|
||||||
ae.getAnOperand().getValue().toInt() = 1
|
ae.getAnOperand().getValue().toInt() = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user