Python: filter local flow from a node to itself

This commit is contained in:
Rasmus Lerchedahl Petersen
2023-12-06 20:57:17 +01:00
parent 5471c92e9f
commit efcdb3e67e

View File

@@ -684,8 +684,13 @@ predicate summaryFlowSteps(Node nodeFrom, Node nodeTo) {
}
predicate variableCaptureFlowStep(Node nodeFrom, Node nodeTo) {
// Blindly applying use-use flow can result in a node that steps to itself, for
// example in while-loops. To uphold dataflow consistency checks, we don't want
// that. However, we do want to allow `[post] n` to `n` (to handle while loops), so
// we should only do the filtering after `IncludePostUpdateFlow` has ben applied.
IncludePostUpdateFlow<PhaseDependentFlow<VariableCapture::valueStep/2>::step/2>::step(nodeFrom,
nodeTo)
nodeTo) and
nodeFrom != nodeTo
}
/** `ModuleVariable`s are accessed via jump steps at runtime. */