Skip to content

Commit ba6ff88

Browse files
committed
Sync files
1 parent b23ab80 commit ba6ff88

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

python/ql/lib/semmle/python/dataflow/new/internal/TypeTracker.qll

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ private module Cached {
3434
CallStep() or
3535
ReturnStep() or
3636
StoreStep(ContentName content) or
37-
LoadStep(ContentName content)
37+
LoadStep(ContentName content) or
38+
JumpStep()
3839

3940
/** Gets the summary resulting from appending `step` to type-tracking summary `tt`. */
4041
cached
@@ -49,6 +50,9 @@ private module Cached {
4950
step = LoadStep(content) and result = MkTypeTracker(hasCall, "")
5051
or
5152
exists(string p | step = StoreStep(p) and content = "" and result = MkTypeTracker(hasCall, p))
53+
or
54+
step = JumpStep() and
55+
result = MkTypeTracker(false, content)
5256
)
5357
}
5458

@@ -67,6 +71,9 @@ private module Cached {
6771
)
6872
or
6973
step = StoreStep(content) and result = MkTypeBackTracker(hasReturn, "")
74+
or
75+
step = JumpStep() and
76+
result = MkTypeBackTracker(false, content)
7077
)
7178
}
7279

@@ -110,12 +117,17 @@ class StepSummary extends TStepSummary {
110117
exists(string content | this = StoreStep(content) | result = "store " + content)
111118
or
112119
exists(string content | this = LoadStep(content) | result = "load " + content)
120+
or
121+
this instanceof JumpStep and result = "jump"
113122
}
114123
}
115124

116125
pragma[noinline]
117126
private predicate smallstepNoCall(Node nodeFrom, TypeTrackingNode nodeTo, StepSummary summary) {
118127
jumpStep(nodeFrom, nodeTo) and
128+
summary = JumpStep()
129+
or
130+
levelStep(nodeFrom, nodeTo) and
119131
summary = LevelStep()
120132
or
121133
exists(string content |

python/ql/lib/semmle/python/dataflow/new/internal/TypeTrackerSpecific.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ predicate simpleLocalFlowStep = DataFlowPrivate::simpleLocalFlowStep/2;
1414

1515
predicate jumpStep = DataFlowPrivate::jumpStep/2;
1616

17+
predicate levelStep(Node pred, Node succ) { none() }
18+
1719
/**
1820
* Gets the name of a possible piece of content. For Python, this is currently only attribute names,
1921
* using the name of the attribute for the corresponding content.

0 commit comments

Comments
 (0)