-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C#: Include "phi reads" in DataFlow::Node
#10927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C#: Include "phi reads" in DataFlow::Node
#10927
Conversation
csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplCommon.qll
Fixed
Show fixed
Hide fixed
f48f2ea to
20fab36
Compare
8395647 to
35843f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
3c57529 to
fa8e721
Compare
8ccdb9c to
17de1f1
Compare
0f7e1c8 to
b2215cc
Compare
7358f28 to
b57847f
Compare
b57847f to
dbeba05
Compare
dbeba05 to
ac29f02
Compare
ac29f02 to
1a8cd6e
Compare
1a8cd6e to
7cab6b5
Compare
michaelnebel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks plausible to me!
|
|
||
| import Cached | ||
|
|
||
| private module Deprecated { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this to avoid deprecation warnings or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was simply to group the deprecated predicates.
In this PR, we add SSA phi-read nodes to the
DataFlow::Nodetype, both for C# and CIL.The benefit of doing this (copied from the other PR) is to be able to avoid the same potential combinatorial explosion that we also avoid by including normal phi nodes in the data flow graph:
graph TD; A-->read_phi; B-->read_phi; C-->read_phi; read_phi-->D; read_phi-->E; read_phi-->F;Assuming that
A,...,Fread the same underlying variable asread_phi, one can reduce the number of data flow edges from 9 (quadratic) to 6 (linear) by including theread_phijoin-point.The work of this PR basically amounts to shifting from
Ssa::DefinitiontoSsaImpl::DefinitionExt.On a local database, making this change I was able to reduce the size of
localFlowStepfrom 89,121,074 to 8,349,054 tuples.