PY: update tests to not use deleted deprecations

This commit is contained in:
Erik Krogh Kristensen
2022-03-07 16:04:09 +01:00
parent 61e282da84
commit 755b0bbcb9
4 changed files with 14 additions and 6 deletions

View File

@@ -1,4 +1,3 @@
WARNING: Predicate ssa_variable_points_to has been deprecated and may be removed in future (SSA.ql:10,3-35)
| __init__.py:0 | __name___0 = ScopeEntryDefinition | 'code' | builtin-class str |
| __init__.py:0 | __name___0 = ScopeEntryDefinition | 'code.package' | builtin-class str |
| __init__.py:0 | __name___0 = ScopeEntryDefinition | 'code.test_package' | builtin-class str |

View File

@@ -3,10 +3,21 @@ private import semmle.python.pointsto.PointsTo
private import semmle.python.pointsto.PointsToContext
import Util
predicate ssa_variable_points_to(
EssaVariable var, PointsToContext context, Object obj, ClassObject cls, @py_object origin
) {
exists(ObjectInternal value |
PointsToInternal::variablePointsTo(var, context, value, origin) and
cls = value.getClass().getSource()
|
obj = value.getSource()
)
}
from EssaVariable v, EssaDefinition def, Object o, ClassObject cls
where
def = v.getDefinition() and
not v.getSourceVariable() instanceof SpecialSsaSourceVariable and
PointsTo::ssa_variable_points_to(v, _, o, cls, _)
ssa_variable_points_to(v, _, o, cls, _)
select locate(def.getLocation(), "abcdegjqmns_"),
v.getRepresentation() + " = " + def.getRepresentation(), repr(o), repr(cls)

View File

@@ -1,5 +1,3 @@
WARNING: Predicate getNode has been deprecated and may be removed in future (TestStep.ql:6,77-84)
WARNING: Predicate getNode has been deprecated and may be removed in future (TestStep.ql:8,15-22)
| Taint simple.test | visitor.py:10 | arg | p2 = simple.test | --> | Taint simple.test | visitor.py:13 | arg | p2 = simple.test |
| Taint simple.test | visitor.py:18 | arg | | --> | Taint simple.test | visitor.py:19 | arg | |
| Taint simple.test | visitor.py:19 | arg | | --> | Taint simple.test | visitor.py:26 | Attribute() | |

View File

@@ -3,6 +3,6 @@ import ExtensionsLib
from TaintedNode n, TaintedNode s
where s = n.getASuccessor()
select "Taint " + n.getTaintKind(), n.getLocation().toString(), n.getNode().getNode().toString(),
select "Taint " + n.getTaintKind(), n.getLocation().toString(), n.getNode().asAstNode().toString(),
n.getContext(), " --> ", "Taint " + s.getTaintKind(), s.getLocation().toString(),
s.getNode().getNode().toString(), s.getContext()
s.getNode().asAstNode().toString(), s.getContext()