mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Update test.cpp
This commit is contained in:
@@ -8,12 +8,12 @@ void test()
|
||||
int a = getAnInt();
|
||||
int b = getAnInt();
|
||||
int c = getAnInt();
|
||||
int x = getAnInt();
|
||||
int x = getAnInt();
|
||||
int y = getAnInt();
|
||||
int d = getADouble();
|
||||
int a1 = getAnUnsignedShort();
|
||||
int b1 = getAnUnsignedShort();
|
||||
int c1 = getAnUnsignedShort();
|
||||
double d = getADouble();
|
||||
unsigned short a1 = getAnUnsignedShort();
|
||||
unsigned short b1 = getAnUnsignedShort();
|
||||
unsigned short c1 = getAnUnsignedShort();
|
||||
|
||||
if (a+b>c) a = c-b; // BAD
|
||||
if (a+b>c) { a = c-b; } // BAD
|
||||
@@ -51,7 +51,7 @@ void test()
|
||||
if (c<=b+a) a = c-b; // BAD
|
||||
if (c<=b+a) { a = c-b; } // BAD
|
||||
|
||||
if (a+b>d) a = d-b; // GOOD
|
||||
if (a+b>d) a = d-b; // BAD
|
||||
if (a+(-x)>c) a = c-(-y); // GOOD
|
||||
if (a+b>c) { b++; a = c-b; } // GOOD
|
||||
if (a+d>c) a = c-d; // GOOD
|
||||
|
||||
Reference in New Issue
Block a user