@@ -30,30 +30,26 @@ private int powerOfTwo() {
3030 * Gets a node that has value 2^n for some n.
3131 */
3232private DataFlow:: Node isPowerOfTwo ( ) {
33- exists ( DataFlow:: Node prev |
34- prev .getIntValue ( ) = powerOfTwo ( )
35- or
36- // Getting around the 32 bit ints in QL. These are some hex values of the form 0x10000000
37- prev .asExpr ( ) .( NumberLiteral ) .getValue ( ) =
38- [ "281474976710656" , "17592186044416" , "1099511627776" , "68719476736" , "4294967296" ]
39- |
40- result = prev .getASuccessor * ( )
41- )
33+ result .getIntValue ( ) = powerOfTwo ( )
34+ or
35+ // Getting around the 32 bit ints in QL. These are some hex values of the form 0x10000000
36+ result .asExpr ( ) .( NumberLiteral ) .getValue ( ) =
37+ [ "281474976710656" , "17592186044416" , "1099511627776" , "68719476736" , "4294967296" ]
38+ or
39+ result = isPowerOfTwo ( ) .getASuccessor ( )
4240}
4341
4442/**
4543 * Gets a node that has value (2^n)-1 for some n.
4644 */
4745private DataFlow:: Node isPowerOfTwoMinusOne ( ) {
48- exists ( DataFlow:: Node prev |
49- prev .getIntValue ( ) = powerOfTwo ( ) - 1
50- or
51- // Getting around the 32 bit ints in QL. These are some hex values of the form 0xfffffff
52- prev .asExpr ( ) .( NumberLiteral ) .getValue ( ) =
53- [ "281474976710655" , "17592186044415" , "1099511627775" , "68719476735" , "4294967295" ]
54- |
55- result = prev .getASuccessor * ( )
56- )
46+ result .getIntValue ( ) = powerOfTwo ( ) - 1
47+ or
48+ // Getting around the 32 bit ints in QL. These are some hex values of the form 0xfffffff
49+ result .asExpr ( ) .( NumberLiteral ) .getValue ( ) =
50+ [ "281474976710655" , "17592186044415" , "1099511627775" , "68719476735" , "4294967295" ]
51+ or
52+ result = isPowerOfTwoMinusOne ( ) .getASuccessor ( )
5753}
5854
5955/**
0 commit comments