Skip to content

Python: filter local self loops#14644

Merged
yoff merged 3 commits intogithub:mainfrom
yoff:python/filter-local-self-loops
Nov 3, 2023
Merged

Python: filter local self loops#14644
yoff merged 3 commits intogithub:mainfrom
yoff:python/filter-local-self-loops

Conversation

@yoff
Copy link
Copy Markdown
Contributor

@yoff yoff commented Oct 31, 2023

These should be filtered on use-use steps, so I have factored those out.
(If self loops appear on the other steps, we want the inconsistency check to tell us.)

Based on #14617 so should be rebased once that is merged.

@yoff yoff force-pushed the python/filter-local-self-loops branch from 04bd447 to 7704385 Compare November 1, 2023 09:34
Comment thread python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPrivate.qll Outdated
yoff and others added 3 commits November 2, 2023 09:31
Factor out use-use flow in order to do this.
Also improve names and comments.

I also wanted to change the types in `difinitionFlowStep`, but
that broke the module instantiation.
…ate.qll

Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
@yoff yoff force-pushed the python/filter-local-self-loops branch from 219a811 to fd757b0 Compare November 2, 2023 08:31
Comment on lines +341 to +342
nodeFrom.(CfgNode).getNode() = pd.getDefiningNode() and
nodeTo.(EssaNode).getVar() = pd.getVariable()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are rewritten to look like the others, with the hope that some day we can drop these casts, declaring the types in the predicate signature. At the moment, this breaks the module instantiation in localFlowStep below.

@yoff yoff marked this pull request as ready for review November 2, 2023 08:35
@yoff yoff requested a review from a team as a code owner November 2, 2023 08:35
@yoff yoff added the no-change-note-required This PR does not need a change note label Nov 2, 2023
@yoff yoff requested a review from RasmusWL November 3, 2023 10:46
Copy link
Copy Markdown
Member

@RasmusWL RasmusWL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@yoff yoff merged commit f969274 into github:main Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants