mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
This frees `Class.qll`, `Exprs.qll`, and `Function.qll` from the clutches of points-to. For the somewhat complicated setup with `getLiteralObject` (an abstract method), I opted for a slightly ugly but workable solution of just defining a predicate on `ImmutableLiteral` that inlines each predicate body, special-cased to the specific instance to which it applies.
18 lines
480 B
Plaintext
18 lines
480 B
Plaintext
/**
|
|
* Much of the QL library handling integral values assumes that
|
|
* equivalence of the DB entities implies equivalence of the
|
|
* Python object and vice-versa.
|
|
* In Python 2, 1L == 1, which can cause problems, so we
|
|
* normalise all longs to ints.
|
|
*/
|
|
|
|
import python
|
|
private import LegacyPointsTo
|
|
|
|
from NumericObject n
|
|
where
|
|
exists(IntegerLiteral i | getLiteralObject(i) = n |
|
|
i.getEnclosingModule().getFile().getShortName() = "test.py"
|
|
)
|
|
select n.toString(), n.repr()
|