mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
Python: filter local flow from a node to itself
This commit is contained in:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user