Skip to content

Commit 38b811b

Browse files
committed
Python: Separate -> PhaseDependentFlow
1 parent 7f6ae8b commit 38b811b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ module StepRelationTransformations {
389389
/**
390390
* A module to separate import-time from run-time.
391391
*
392-
* We really have two local flow relations, on for module initialisation time (or _import time_) and one for runtime.
392+
* We really have two local flow relations, one for module initialisation time (or _import time_) and one for runtime.
393393
* Consider a read from a global variable `x = foo`. At import time there should be a local flow step from `foo` to `x`,
394394
* while at runtime there should be a jump step from the module variable corresponding to `foo` to `x`.
395395
*
@@ -404,7 +404,7 @@ module StepRelationTransformations {
404404
* with the heuristic that global variables act according to import time rules at top-level program points and according
405405
* to runtime rules everywhere else. This will forego some import time local flow but otherwise be consistent.
406406
*/
407-
module Separate<stepSig/2 rawStep> {
407+
module PhaseDependentFlow<stepSig/2 rawStep> {
408408
/**
409409
* Holds if `node` is found at the top level of a module.
410410
*/
@@ -476,7 +476,7 @@ predicate simpleLocalFlowStep(Node nodeFrom, Node nodeTo) {
476476
* or at runtime when callables in the module are called.
477477
*/
478478
predicate simpleLocalFlowStepForTypetracking(Node nodeFrom, Node nodeTo) {
479-
IncludePostUpdateFlow<Separate<EssaFlow::essaFlowStep/2>::step/2>::step(nodeFrom, nodeTo)
479+
IncludePostUpdateFlow<PhaseDependentFlow<EssaFlow::essaFlowStep/2>::step/2>::step(nodeFrom, nodeTo)
480480
}
481481

482482
private predicate summaryLocalStep(Node nodeFrom, Node nodeTo) {
@@ -485,7 +485,7 @@ private predicate summaryLocalStep(Node nodeFrom, Node nodeTo) {
485485
}
486486

487487
predicate summaryFlowSteps(Node nodeFrom, Node nodeTo) {
488-
IncludePostUpdateFlow<Separate<summaryLocalStep/2>::step/2>::step(nodeFrom, nodeTo)
488+
IncludePostUpdateFlow<PhaseDependentFlow<summaryLocalStep/2>::step/2>::step(nodeFrom, nodeTo)
489489
}
490490

491491
/** `ModuleVariable`s are accessed via jump steps at runtime. */

python/ql/test/experimental/dataflow/module-initialization/localFlow.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module ImportTimeLocalFlowTest implements FlowTestSig {
1212
// results are displayed next to `nodeTo`, so we need a line to write on
1313
nodeTo.getLocation().getStartLine() > 0 and
1414
nodeTo.asVar() instanceof GlobalSsaVariable and
15-
DP::Separate<DP::EssaFlow::essaFlowStep/2>::importTimeStep(nodeFrom, nodeTo)
15+
DP::PhaseDependentFlow<DP::EssaFlow::essaFlowStep/2>::importTimeStep(nodeFrom, nodeTo)
1616
}
1717
}
1818

0 commit comments

Comments
 (0)