mirror of
https://github.com/github/codeql.git
synced 2026-02-12 13:11:20 +01:00
Python: Remove points-to references from python.qll
For now, these have just been made into `private` imports. After doing
this, I went through all of the (now not compiling) files and added in
private imports to the modules that they actually depended on.
I also added an explicit import of `LegacyPointsTo` (even though it may
be unnecessary) in cases where the points-to dependency was somewhat
surprising (and one we want to get rid of). This was primarily inside
the various SSA layers.
For modules inside `semmle.python.{types, objects, pointsto}` I did not
bother, as these are fairly clearly related to points-to.
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
import semmle.python.pointsto.PointsTo
|
||||
|
||||
predicate rhs_in_expr(ControlFlowNode rhs, Compare cmp) {
|
||||
exists(Cmpop op, int i | cmp.getOp(i) = op and cmp.getComparator(i) = rhs.getNode() |
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
private import semmle.python.objects.ObjectInternal
|
||||
private import semmle.python.objects.ObjectAPI
|
||||
|
||||
/** Holds if the comparison `comp` uses `is` or `is not` (represented as `op`) to compare its `left` and `right` arguments. */
|
||||
predicate comparison_using_is(Compare comp, ControlFlowNode left, Cmpop op, ControlFlowNode right) {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
private import semmle.python.objects.ObjectAPI
|
||||
|
||||
predicate assignment(AssignStmt a, Expr left, Expr right) {
|
||||
a.getATarget() = left and a.getValue() = right
|
||||
|
||||
@@ -14,7 +14,6 @@ import python
|
||||
private import LegacyPointsTo
|
||||
import Variables.MonkeyPatched
|
||||
import Loop
|
||||
import semmle.python.pointsto.PointsTo
|
||||
|
||||
predicate guarded_against_name_error(Name u) {
|
||||
exists(Try t | t.getBody().getAnItem().contains(u) |
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
import Undefined
|
||||
import semmle.python.pointsto.PointsTo
|
||||
|
||||
predicate uninitialized_local(NameNode use) {
|
||||
exists(FastLocalVariable local | use.uses(local) or use.deletes(local) |
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
import semmle.python.pointsto.PointsTo
|
||||
import semmle.python.pointsto.PointsToContext
|
||||
|
||||
predicate trivial(ControlFlowNode f) {
|
||||
f.getNode() instanceof Parameter
|
||||
|
||||
Reference in New Issue
Block a user