mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
CPP: Fix query.
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
| bsc.cpp:6:10:6:32 | ... > ... | Potential unsafe sign check of a bitwise operation. |
|
||||
| bsc.cpp:10:10:10:33 | ... >= ... | Potential unsafe sign check of a bitwise operation. |
|
||||
| bsc.cpp:18:10:18:28 | ... > ... | Potential unsafe sign check of a bitwise operation. |
|
||||
| bsc.cpp:30:10:30:20 | ... < ... | Potential unsafe sign check of a bitwise operation. |
|
||||
| bsc.cpp:22:10:22:28 | ... < ... | Potential unsafe sign check of a bitwise operation. |
|
||||
|
||||
@@ -19,7 +19,7 @@ bool is_bit31_set_bad_v1(int x) {
|
||||
}
|
||||
|
||||
bool is_bit31_set_bad_v2(int x) {
|
||||
return 0 < (x & (1 << 31)); // BAD [NOT DETECTED]
|
||||
return 0 < (x & (1 << 31)); // BAD
|
||||
}
|
||||
|
||||
bool is_bit31_set_good(int x) {
|
||||
@@ -27,5 +27,5 @@ bool is_bit31_set_good(int x) {
|
||||
}
|
||||
|
||||
bool deliberately_checking_sign(int x, int y) {
|
||||
return (x & y) < 0; // GOOD (use of `<` implies the sign check is intended) [FALSE POSITIVE]
|
||||
return (x & y) < 0; // GOOD (use of `<` implies the sign check is intended)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user