mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
This adds Alert annotations for alerts that seem intentional by the test but has not been annotated with 'NOT OK', or the comment was in the wrong place. In a few cases I included 'Source' expectations to make it easier to see what happened. Other 'Source' expectations will be added in bulk a later commit.
21 lines
362 B
JavaScript
21 lines
362 B
JavaScript
function bitIsSet(x, n) {
|
|
return (x & (1<<n)) > 0; // $ Alert
|
|
}
|
|
|
|
console.log(bitIsSet(-1, 31)); // prints 'false'
|
|
|
|
(x & 3) > 0; // this is fine
|
|
|
|
|
|
x = -1;
|
|
console.log((x | 0) > (0)); // prints 'false'
|
|
|
|
console.log((x >>> 0) > 0); // $ Alert - prints 'true'
|
|
|
|
|
|
console.log((x << 16 >> 16) > 0); // prints 'false'
|
|
|
|
|
|
(x & 256) > 0;
|
|
|
|
(x & 0x100000000) > 0; // $ Alert
|