Skip to content

Commit 9820249

Browse files
committed
Python tests: Further hiding of special ESSA variables in tests, to ease transition from '*' to '$' variable.
1 parent d776d9f commit 9820249

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

python/ql/test/library-tests/PointsTo/new/Definitions.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import python
44
import Util
55

66
from EssaDefinition def, Variable v
7-
where v = def.getSourceVariable()
7+
where v = def.getSourceVariable() and not v instanceof SpecialSsaSourceVariable
88
select locate(def.getLocation(), "abdgk"), v.toString(), def.getAQlClass()

python/ql/test/library-tests/PointsTo/new/SSA.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ private import semmle.python.pointsto.PointsToContext
55
import Util
66

77
from EssaVariable v, EssaDefinition def, Object o, ClassObject cls
8-
where def = v.getDefinition() and
8+
where def = v.getDefinition() and
9+
not v.getSourceVariable() instanceof SpecialSsaSourceVariable and
910
PointsTo::ssa_variable_points_to(v, _, o, cls, _)
1011
select locate(def.getLocation(), "abcdegjqmns_"), v.getRepresentation() + " = " + def.getRepresentation(), repr(o), repr(cls)

python/ql/test/library-tests/PointsTo/new/SourceEdgeDefinitions.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ import semmle.python.pointsto.PointsTo
66
import Util
77

88
from SsaSourceVariable var, ControlFlowNode use, BasicBlock pred
9-
where var.hasRefinementEdge(use, pred, _)
9+
where var.hasRefinementEdge(use, pred, _) and not var instanceof SpecialSsaSourceVariable
1010
select locate(pred.getLastNode().getLocation(), "ab"), var.(Variable), use.toString()

python/ql/test/library-tests/PointsTo/new/SourceNodeDefinitions.ql

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import semmle.python.pointsto.PointsTo
66
import Util
77

88
from SsaSourceVariable var, ControlFlowNode defn, string kind
9-
where
10-
var.hasDefiningNode(defn) and kind = "definition"
11-
or
12-
var.hasRefinement(_, defn) and kind = "refinement"
9+
where not var instanceof SpecialSsaSourceVariable and
10+
(
11+
var.hasDefiningNode(defn) and kind = "definition"
12+
or
13+
var.hasRefinement(_, defn) and kind = "refinement"
14+
)
1315
select locate(defn.getLocation(), "ab"), var.(Variable), defn.toString(), kind

python/ql/test/library-tests/PointsTo/new/VarUses.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ import semmle.python.pointsto.PointsTo
55
import Util
66

77
from SsaSourceVariable var, ControlFlowNode use
8-
where use = var.getAUse() or var.hasRefinement(use, _)
8+
where (use = var.getAUse() or var.hasRefinement(use, _)) and not var instanceof SpecialSsaSourceVariable
99
select locate(use.getLocation(), "abd"), var.getName(), use.toString()

0 commit comments

Comments
 (0)