Skip to content

Commit e098404

Browse files
committed
Python: Get rid of points-to from Definitions.qll
Turns out the `ImportTime` module (despite living in `semmle.python.types` does not actually depend on points-to, so some of the `LegacyPointsTo` imports could be replaced or removed.
1 parent 7328f26 commit e098404

File tree

8 files changed

+7
-2
lines changed

8 files changed

+7
-2
lines changed

python/ql/lib/LegacyPointsTo.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import semmle.python.types.FunctionObject
3232
import semmle.python.types.ModuleObject
3333
import semmle.python.types.Exceptions
3434
import semmle.python.types.Properties
35-
import semmle.python.types.ImportTime
3635
import semmle.python.types.Descriptors
3736
import semmle.python.SelfAttribute
3837

python/ql/lib/analysis/DefinitionTracking.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import python
66
private import LegacyPointsTo
7+
private import semmle.python.types.ImportTime
78
import IDEContextual
89

910
private newtype TDefinition =

python/ql/lib/semmle/python/essa/Definitions.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import python
1111
* Escaping globals -- Global variables that have definitions and at least one of those definitions is in another scope.
1212
*/
1313

14-
private import LegacyPointsTo
14+
private import semmle.python.types.ImportTime
1515
private import semmle.python.essa.SsaDefinitions
1616

1717
/** A source language variable, to be converted into a set of SSA variables. */

python/ql/src/Imports/Cyclic.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import python
22
private import LegacyPointsTo
3+
private import semmle.python.types.ImportTime
34

45
predicate is_import_time(Stmt s) { not s.getScope+() instanceof Function }
56

python/ql/src/Imports/UnintentionalImport.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import python
1616
private import LegacyPointsTo
17+
private import semmle.python.types.ImportTime
1718

1819
predicate import_star(ImportStar imp, ModuleValue exporter) {
1920
exporter.importedAs(imp.getImportedModuleName())

python/ql/src/Variables/UndefinedGlobal.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import python
1414
private import LegacyPointsTo
15+
private import semmle.python.types.ImportTime
1516
import Variables.MonkeyPatched
1617
import Loop
1718

python/ql/src/Variables/UndefinedPlaceHolder.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import python
1515
import Variables.MonkeyPatched
1616
private import LegacyPointsTo
17+
private import semmle.python.types.ImportTime
1718

1819
/* Local variable part */
1920
predicate initialized_as_local(PlaceHolder use) {

python/ql/test/library-tests/PointsTo/general/GlobalPointsTo.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import python
22
private import LegacyPointsTo
3+
private import semmle.python.types.ImportTime
34
import interesting
45

56
from int line, ControlFlowNodeWithPointsTo f, Object o, ImportTimeScope n

0 commit comments

Comments
 (0)