mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C++: Add a FP from DCA.
This commit is contained in:
@@ -14,3 +14,4 @@
|
||||
| test.cpp:276:11:276:19 | ... > ... | Unsigned subtraction can never be negative. |
|
||||
| test.cpp:288:10:288:18 | ... > ... | Unsigned subtraction can never be negative. |
|
||||
| test.cpp:312:9:312:25 | ... > ... | Unsigned subtraction can never be negative. |
|
||||
| test.cpp:335:6:335:18 | ... > ... | Unsigned subtraction can never be negative. |
|
||||
|
||||
@@ -321,3 +321,18 @@ void test19() {
|
||||
total += get_data();
|
||||
}
|
||||
}
|
||||
|
||||
void test20(int a, bool b, unsigned long c)
|
||||
{
|
||||
int x = 0;
|
||||
|
||||
if(b) {
|
||||
x = (a - c) / 2;
|
||||
} else {
|
||||
x = a - c;
|
||||
}
|
||||
|
||||
if (a - c - x > 0) // GOOD [FALSE POSITIVE]
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user