зеркало из https://github.com/github/codeql.git
CPP: Fix UncheckedLeapYearAfterYearModification FPs.
This commit is contained in:
Родитель
cff3f9bdaf
Коммит
7fca220eda
|
@ -91,6 +91,9 @@ abstract class LeapYearFieldAccess extends YearFieldAccess {
|
|||
mulBy100.getAChild().getValue().toInt() = 100 )))
|
||||
or exists( BinaryArithmeticOperation bao |
|
||||
bao = op.getAnOperand()
|
||||
// we're specifically interested in calculations that update the existing
|
||||
// value (like `x = x + 1`), so look for a child `YearFieldAccess`.
|
||||
and bao.getAChild*() instanceof YearFieldAccess
|
||||
and not ( bao.getAChild().getValue().toInt() = 1900
|
||||
or bao.getAChild().getValue().toInt() = 2000
|
||||
or bao.getAChild().getValue().toInt() = 1980
|
||||
|
|
|
@ -9,4 +9,3 @@
|
|||
| test.cpp:636:11:636:17 | tm_year | Field $@ on variable $@ has been modified, but no appropriate check for LeapYear was found. | test.cpp:56:6:56:12 | tm_year | tm_year | test.cpp:628:12:628:19 | timeinfo | timeinfo |
|
||||
| test.cpp:640:5:640:9 | wYear | Field $@ on variable $@ has been modified, but no appropriate check for LeapYear was found. | test.cpp:12:7:12:11 | wYear | wYear | test.cpp:629:13:629:14 | st | st |
|
||||
| test.cpp:642:5:642:9 | wYear | Field $@ on variable $@ has been modified, but no appropriate check for LeapYear was found. | test.cpp:12:7:12:11 | wYear | wYear | test.cpp:629:13:629:14 | st | st |
|
||||
| test.cpp:677:5:677:11 | tm_year | Field $@ on variable $@ has been modified, but no appropriate check for LeapYear was found. | test.cpp:56:6:56:12 | tm_year | tm_year | test.cpp:664:12:664:12 | t | t |
|
||||
|
|
Загрузка…
Ссылка в новой задаче