mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Python: Add overlay annotations to AST classes
... and everything else that it depends on.
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
private import semmle.python.internal.CachedStages
|
private import semmle.python.internal.CachedStages
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
* WARNING: Any modifications to this file will be lost.
|
* WARNING: Any modifications to this file will be lost.
|
||||||
* Relations can be changed by modifying master.py.
|
* Relations can be changed by modifying master.py.
|
||||||
*/
|
*/
|
||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Provides classes representing Python classes.
|
* Provides classes representing Python classes.
|
||||||
*/
|
*/
|
||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Provides classes representing comments in Python.
|
* Provides classes representing comments in Python.
|
||||||
*/
|
*/
|
||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
|
|
||||||
/** The base class for list, set and dictionary comprehensions, and generator expressions. */
|
/** The base class for list, set and dictionary comprehensions, and generator expressions. */
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
/** Standard builtin types and modules */
|
/** Standard builtin types and modules */
|
||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
private import python
|
private import python
|
||||||
private import semmle.python.internal.CachedStages
|
private import semmle.python.internal.CachedStages
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
/** Provides classes for working with files and folders. */
|
/** Provides classes for working with files and folders. */
|
||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
private import codeql.util.FileSystem
|
private import codeql.util.FileSystem
|
||||||
@@ -178,6 +180,7 @@ class Container extends Impl::Container {
|
|||||||
|
|
||||||
override Container getParentContainer() { result = super.getParentContainer() }
|
override Container getParentContainer() { result = super.getParentContainer() }
|
||||||
|
|
||||||
|
overlay[global]
|
||||||
Container getChildContainer(string baseName) {
|
Container getChildContainer(string baseName) {
|
||||||
result = this.getAChildContainer() and
|
result = this.getAChildContainer() and
|
||||||
result.getBaseName() = baseName
|
result.getBaseName() = baseName
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
private import semmle.python.internal.CachedStages
|
private import semmle.python.internal.CachedStages
|
||||||
private import codeql.controlflow.BasicBlock as BB
|
private import codeql.controlflow.BasicBlock as BB
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
|
|
||||||
/** A basic block which terminates in a condition, splitting the subsequent control flow */
|
/** A basic block which terminates in a condition, splitting the subsequent control flow */
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
private import semmle.python.types.Builtins
|
private import semmle.python.types.Builtins
|
||||||
private import semmle.python.internal.CachedStages
|
private import semmle.python.internal.CachedStages
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
|
|
||||||
class KeyValuePair extends KeyValuePair_, DictDisplayItem {
|
class KeyValuePair extends KeyValuePair_, DictDisplayItem {
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
private import semmle.python.internal.CachedStages
|
private import semmle.python.internal.CachedStages
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
|
|
||||||
/** The base class for operators */
|
/** The base class for operators */
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Wrapping generated AST classes: `Pattern_` and subclasses.
|
* Wrapping generated AST classes: `Pattern_` and subclasses.
|
||||||
*/
|
*/
|
||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
/** SSA library */
|
/** SSA library */
|
||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
private import semmle.python.dataflow.new.internal.ImportResolution
|
private import semmle.python.dataflow.new.internal.ImportResolution
|
||||||
|
|
||||||
@@ -6,6 +9,7 @@ private import semmle.python.dataflow.new.internal.ImportResolution
|
|||||||
*
|
*
|
||||||
* This aims to be the same as m.getAnExport(), but without using the points-to machinery.
|
* This aims to be the same as m.getAnExport(), but without using the points-to machinery.
|
||||||
*/
|
*/
|
||||||
|
overlay[global]
|
||||||
private string getAModuleExport(Module m) {
|
private string getAModuleExport(Module m) {
|
||||||
py_exports(m, result)
|
py_exports(m, result)
|
||||||
or
|
or
|
||||||
@@ -76,6 +80,7 @@ class Scope extends Scope_ {
|
|||||||
predicate isTopLevel() { this.getEnclosingModule() = this.getEnclosingScope() }
|
predicate isTopLevel() { this.getEnclosingModule() = this.getEnclosingScope() }
|
||||||
|
|
||||||
/** Holds if this scope is deemed to be public */
|
/** Holds if this scope is deemed to be public */
|
||||||
|
overlay[global]
|
||||||
predicate isPublic() {
|
predicate isPublic() {
|
||||||
/* Not inside a function */
|
/* Not inside a function */
|
||||||
not this.getEnclosingScope() instanceof Function and
|
not this.getEnclosingScope() instanceof Function and
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
|
|
||||||
/** A statement */
|
/** A statement */
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
|
|
||||||
/** A variable, either a global or local variable (including parameters) */
|
/** A variable, either a global or local variable (including parameters) */
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
/*
|
/*
|
||||||
* Classification of variables. These should be non-overlapping and complete.
|
* Classification of variables. These should be non-overlapping and complete.
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Library for SSA representation (Static Single Assignment form).
|
* Library for SSA representation (Static Single Assignment form).
|
||||||
*/
|
*/
|
||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
private import SsaCompute
|
private import SsaCompute
|
||||||
|
|||||||
@@ -88,6 +88,8 @@
|
|||||||
* ```
|
* ```
|
||||||
* and thus it falls out that `g3` must be `1`.
|
* and thus it falls out that `g3` must be `1`.
|
||||||
*/
|
*/
|
||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
private import semmle.python.internal.CachedStages
|
private import semmle.python.internal.CachedStages
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
* Provides classes and predicates for determining the uses and definitions of
|
* Provides classes and predicates for determining the uses and definitions of
|
||||||
* variables for ESSA form.
|
* variables for ESSA form.
|
||||||
*/
|
*/
|
||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
private import semmle.python.internal.CachedStages
|
private import semmle.python.internal.CachedStages
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ module Stages {
|
|||||||
* Computes predicates based on the AST.
|
* Computes predicates based on the AST.
|
||||||
* These include SSA and basic-blocks.
|
* These include SSA and basic-blocks.
|
||||||
*/
|
*/
|
||||||
|
overlay[local]
|
||||||
cached
|
cached
|
||||||
module AST {
|
module AST {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
overlay[local?]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
private import LegacyPointsTo
|
private import LegacyPointsTo
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
overlay[local]
|
||||||
|
module;
|
||||||
|
|
||||||
import python
|
import python
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user