mirror of
https://github.com/github/codeql.git
synced 2026-02-18 07:53:43 +01:00
Python: Implement new data flow interface
This commit is contained in:
@@ -24,6 +24,6 @@ private import python
|
||||
module DataFlow {
|
||||
private import internal.DataFlowImplSpecific
|
||||
private import codeql.dataflow.DataFlow
|
||||
import DataFlowMake<PythonDataFlow>
|
||||
import DataFlowMake<Location, PythonDataFlow>
|
||||
import internal.DataFlowImpl1
|
||||
}
|
||||
|
||||
@@ -19,6 +19,6 @@ module TaintTracking {
|
||||
private import semmle.python.dataflow.new.internal.DataFlowImplSpecific
|
||||
private import semmle.python.dataflow.new.internal.TaintTrackingImplSpecific
|
||||
private import codeql.dataflow.TaintTracking
|
||||
import TaintFlowMake<PythonDataFlow, PythonTaintTracking>
|
||||
import TaintFlowMake<Location, PythonDataFlow, PythonTaintTracking>
|
||||
import internal.tainttracking1.TaintTrackingImpl
|
||||
}
|
||||
|
||||
@@ -1595,7 +1595,7 @@ class FlowSummaryNode extends Node, TFlowSummaryNode {
|
||||
override string toString() { result = this.getSummaryNode().toString() }
|
||||
|
||||
// Hack to return "empty location"
|
||||
override predicate hasLocationInfo(
|
||||
deprecated override predicate hasLocationInfo(
|
||||
string file, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
file = "" and
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
private import DataFlowImplSpecific
|
||||
private import codeql.dataflow.internal.DataFlowImpl
|
||||
import MakeImpl<PythonDataFlow>
|
||||
private import semmle.python.Files
|
||||
import MakeImpl<Location, PythonDataFlow>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
private import DataFlowImplSpecific
|
||||
private import codeql.dataflow.internal.DataFlowImplCommon
|
||||
import MakeImplCommon<PythonDataFlow>
|
||||
private import semmle.python.Files
|
||||
import MakeImplCommon<Location, PythonDataFlow>
|
||||
|
||||
@@ -15,7 +15,7 @@ module Public {
|
||||
import DataFlowUtil
|
||||
}
|
||||
|
||||
module PythonDataFlow implements InputSig {
|
||||
module PythonDataFlow implements InputSig<Python::Location> {
|
||||
import Private
|
||||
import Public
|
||||
|
||||
|
||||
@@ -148,6 +148,7 @@ class Node extends TNode {
|
||||
DataFlowCallable getEnclosingCallable() { result = getCallableScope(this.getScope()) }
|
||||
|
||||
/** Gets the location of this node */
|
||||
cached
|
||||
Location getLocation() { none() }
|
||||
|
||||
/**
|
||||
@@ -157,8 +158,7 @@ class Node extends TNode {
|
||||
* For more information, see
|
||||
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
|
||||
*/
|
||||
cached
|
||||
predicate hasLocationInfo(
|
||||
deprecated predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
Stages::DataFlow::ref() and
|
||||
|
||||
@@ -9,7 +9,7 @@ private import DataFlowImplSpecific as DataFlowImplSpecific
|
||||
private import DataFlowImplSpecific::Private
|
||||
private import DataFlowImplSpecific::Public
|
||||
|
||||
module Input implements InputSig<DataFlowImplSpecific::PythonDataFlow> {
|
||||
module Input implements InputSig<Location, DataFlowImplSpecific::PythonDataFlow> {
|
||||
class SummarizedCallableBase = string;
|
||||
|
||||
ArgumentPosition callbackSelfParameterPosition() { result.isLambdaSelf() }
|
||||
@@ -83,7 +83,7 @@ module Input implements InputSig<DataFlowImplSpecific::PythonDataFlow> {
|
||||
}
|
||||
}
|
||||
|
||||
private import Make<DataFlowImplSpecific::PythonDataFlow, Input> as Impl
|
||||
private import Make<Location, DataFlowImplSpecific::PythonDataFlow, Input> as Impl
|
||||
|
||||
private module StepsInput implements Impl::Private::StepsInputSig {
|
||||
DataFlowCall getACall(Public::SummarizedCallable sc) {
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
|
||||
private import codeql.dataflow.TaintTracking
|
||||
private import DataFlowImplSpecific
|
||||
private import semmle.python.Files
|
||||
|
||||
module PythonTaintTracking implements InputSig<PythonDataFlow> {
|
||||
module PythonTaintTracking implements InputSig<Location, PythonDataFlow> {
|
||||
import TaintTrackingPrivate
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user