mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Python: Fix library tests
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from ClassValue cls, string description
|
||||
where
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from string txt, Value val
|
||||
where
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from FunctionValue v, string name
|
||||
where
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from Value val, string name
|
||||
where
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from ControlFlowNode call, Value func
|
||||
where call = func.getACall()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from CallNode call, CallableValue callable, int i
|
||||
select call.getLocation().getStartLine(), call.toString(), callable.toString(), i,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from CallNode call, CallableValue callable, string name
|
||||
select call.getLocation().getStartLine(), call.toString(), callable.toString(), name,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from CallableValue callable, int i
|
||||
select callable.toString(), i, callable.getParameter(i).toString()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from CallableValue callable, string name
|
||||
select callable.toString(), name, callable.getParameterByName(name).toString()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import python
|
||||
import semmle.python.pointsto.PointsTo
|
||||
import semmle.python.objects.ObjectInternal
|
||||
private import LegacyPointsTo
|
||||
|
||||
from NameNode f, Context ctx, ObjectInternal v
|
||||
where
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from CallNode call, FunctionObject func, string kind
|
||||
where
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from FunctionObject f
|
||||
where f.neverReturns()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from Call c, FunctionObject f
|
||||
where
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
string repr(Object o) {
|
||||
not o instanceof StringObject and not o = theBoundMethodType() and result = o.toString()
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import python
|
||||
import semmle.python.pointsto.PointsTo
|
||||
import semmle.python.pointsto.PointsToContext
|
||||
import semmle.python.objects.ObjectInternal
|
||||
private import LegacyPointsTo
|
||||
|
||||
from ControlFlowNode f, PointsToContext ctx, Value obj, ControlFlowNode orig
|
||||
where
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from ClassObject cls, ClassObject base, int n
|
||||
where
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from Call c, FunctionObject f
|
||||
where f.getACall().getNode() = c
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from ClassObject cls, string name
|
||||
where class_declares_attribute(cls, name)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from ClassObject cls, ClassObject meta
|
||||
where
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from ClassObject cls, ClassObject sup
|
||||
where
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from ClassObject cls, string reason
|
||||
where
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from ClassObject cls, string style
|
||||
where
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import python
|
||||
private import semmle.python.objects.ObjectInternal
|
||||
private import LegacyPointsTo
|
||||
|
||||
/** An unknown type. Not usually visible. */
|
||||
class UnknownType extends UnknownClassInternal {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import python
|
||||
import Util
|
||||
private import LegacyPointsTo
|
||||
|
||||
from ControlFlowNode call, FunctionObject func
|
||||
where call = func.getACall()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import python
|
||||
import Util
|
||||
private import LegacyPointsTo
|
||||
|
||||
from ClassMethodObject cm, CallNode call
|
||||
where call = cm.getACall()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import python
|
||||
import Util
|
||||
private import LegacyPointsTo
|
||||
|
||||
from Scope s, string name, Object val
|
||||
where
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import python
|
||||
import Util
|
||||
import semmle.python.pointsto.PointsTo
|
||||
private import LegacyPointsTo
|
||||
|
||||
/* This test should return _no_ results. */
|
||||
predicate relevant_node(ControlFlowNode n) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import python
|
||||
import Util
|
||||
import semmle.python.pointsto.PointsTo
|
||||
private import LegacyPointsTo
|
||||
|
||||
from ControlFlowNode f, ControlFlowNode x
|
||||
where PointsTo::pointsTo(f, _, ObjectInternal::unknown(), x)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import python
|
||||
import Util
|
||||
import semmle.python.pointsto.PointsTo
|
||||
import semmle.python.pointsto.PointsToContext
|
||||
private import LegacyPointsTo
|
||||
|
||||
from ControlFlowNode f, Object o, ClassObject c, ControlFlowNode x, PointsToContext ctx
|
||||
where PointsTo::points_to(f, ctx, o, c, x)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import python
|
||||
import Util
|
||||
import semmle.python.pointsto.PointsTo
|
||||
private import LegacyPointsTo
|
||||
|
||||
from ControlFlowNode f, Object o, ClassObject c, ControlFlowNode x
|
||||
where PointsTo::points_to(f, _, o, c, x)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import python
|
||||
private import semmle.python.pointsto.PointsTo
|
||||
private import LegacyPointsTo
|
||||
import Util
|
||||
|
||||
from ControlFlowNode f, Context ctx
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import python
|
||||
private import semmle.python.pointsto.PointsTo
|
||||
private import semmle.python.pointsto.PointsToContext
|
||||
private import LegacyPointsTo
|
||||
import Util
|
||||
|
||||
predicate ssa_variable_points_to(
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import python
|
||||
import semmle.python.pointsto.PointsTo
|
||||
import Util
|
||||
|
||||
from SsaSourceVariable var, ControlFlowNode use, BasicBlock pred
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import python
|
||||
import semmle.python.pointsto.PointsTo
|
||||
import Util
|
||||
|
||||
from SsaSourceVariable var, ControlFlowNode defn, string kind
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import python
|
||||
private import semmle.python.pointsto.PointsTo
|
||||
private import semmle.python.objects.ObjectInternal
|
||||
private import LegacyPointsTo
|
||||
import Util
|
||||
|
||||
from EssaVariable var, string name, ObjectInternal o, Context ctx
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import python
|
||||
import semmle.python.pointsto.PointsTo
|
||||
import Util
|
||||
|
||||
from EssaVariable var, ControlFlowNode use
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import python
|
||||
import semmle.python.pointsto.PointsTo
|
||||
import semmle.python.pointsto.PointsToContext
|
||||
private import LegacyPointsTo
|
||||
import Util
|
||||
|
||||
from
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import python
|
||||
import semmle.python.objects.ObjectInternal
|
||||
private import LegacyPointsTo
|
||||
|
||||
bindingset[which]
|
||||
string locate(Location l, string which) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import python
|
||||
import semmle.python.pointsto.PointsTo
|
||||
private import LegacyPointsTo
|
||||
import Util
|
||||
|
||||
from SsaSourceVariable var, ControlFlowNode use
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from PythonFunctionValue func
|
||||
select func, func.getACall()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from ModuleValue mv, ControlFlowNode ref, string local_external
|
||||
where
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from ModuleValue mv, ControlFlowNode ref, string in_stdlib, string local_external, string is_missing
|
||||
where
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
|
||||
from PyFunctionObject f
|
||||
select f.toString(), f.getAnInferredReturnType().toString()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import python
|
||||
import semmle.python.pointsto.PointsTo
|
||||
private import LegacyPointsTo
|
||||
|
||||
from Value sup, Value cls
|
||||
where Expressions::requireSubClass(cls, sup)
|
||||
|
||||
Reference in New Issue
Block a user