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