Merge pull request #1575 from jbj/UncheckedLeapYear-bb

C++: Fix performance of unchecked leap year query
This commit is contained in:
Geoffrey White
2019-07-11 13:57:07 +01:00
committed by GitHub

View File

@@ -24,7 +24,7 @@ where
exists(LeapYearFieldAccess yfacheck |
yfacheck.getQualifier() = var.getAnAccess() and
yfacheck.isUsedInCorrectLeapYearCheck() and
yfacheck = yfa.getASuccessor*()
yfacheck.getBasicBlock() = yfa.getBasicBlock().getASuccessor*()
)
or
// 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.isModified() and
(
mfa = yfa.getASuccessor*() or
yfa = mfa.getASuccessor*()
mfa.getBasicBlock() = yfa.getBasicBlock().getASuccessor*() or
yfa.getBasicBlock() = mfa.getBasicBlock().getASuccessor+()
) and
ae = mfa.getEnclosingElement() and
ae.getAnOperand().getValue().toInt() = 1