mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
[CPP-434] Rename everything to SignedOverflowCheck. Add .qlhelp. Deal with addition only, not subtraction.
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
| SignedComparisons.cpp:8:12:8:22 | ... < ... | Testing for signed overflow/underflow may produce undefined results. |
|
||||
| SignedComparisons.cpp:11:9:11:20 | ... < ... | Testing for signed overflow/underflow may produce undefined results. |
|
||||
| SignedComparisons.cpp:21:12:21:26 | ... < ... | Testing for signed overflow/underflow may produce undefined results. |
|
||||
| SignedComparisons.cpp:24:9:24:23 | ... < ... | Testing for signed overflow/underflow may produce undefined results. |
|
||||
@@ -1 +0,0 @@
|
||||
Likely Bugs/Arithmetic/SignedComparisons.ql
|
||||
@@ -7,9 +7,6 @@ bool cannotHoldAnother8(int n1) {
|
||||
// msvc 19.22 /O2: not deleted
|
||||
return n1 + 8 < n1; // BAD
|
||||
}
|
||||
bool canHoldPreceding16(int n1) {
|
||||
return n1 - 16 < n1;
|
||||
}
|
||||
|
||||
/* 2. Signed comparison with a narrower unsigned type. The narrower
|
||||
type gets promoted to the (signed) larger type, and so the
|
||||
@@ -20,9 +17,6 @@ bool cannotHoldAnotherUShort(int n1, unsigned short delta) {
|
||||
// msvc 19.22 /O2: not deleted
|
||||
return n1 + delta < n1; // BAD
|
||||
}
|
||||
bool canHoldPrecedingUShort(int n1, unsigned short delta) {
|
||||
return n1 - delta < n1;
|
||||
}
|
||||
|
||||
/* 3. Signed comparison with a non-narrower unsigned type. The
|
||||
signed type gets promoted to (a possibly wider) unsigned type,
|
||||
@@ -33,6 +27,3 @@ bool cannotHoldAnotherUInt(int n1, unsigned int delta) {
|
||||
// msvc 19.22 /O2: not deleted
|
||||
return n1 + delta < n1; // GOOD
|
||||
}
|
||||
bool canHoldPrecedingUInt(int n1, unsigned int delta) {
|
||||
return n1 - delta < n1;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
| SignedOverflowCheck.cpp:8:12:8:22 | ... < ... | Testing for signed overflow/underflow may produce undefined results. |
|
||||
| SignedOverflowCheck.cpp:18:12:18:26 | ... < ... | Testing for signed overflow/underflow may produce undefined results. |
|
||||
@@ -0,0 +1 @@
|
||||
Likely Bugs/Arithmetic/SignedOverflowCheck.ql
|
||||
Reference in New Issue
Block a user