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
Data flow: Synthesize parameter return nodes #16394
base: main
Are you sure you want to change the base?
Conversation
7b3811a
to
c14d652
Compare
c14d652
to
4b024f8
Compare
|
||
/** | ||
* Gets the MaD string representation of the the return node `node`. | ||
* Gets the MaD string represention of return through parameter at position |
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.
* Gets the MaD string represention of return through parameter at position | |
* Gets the MaD string representation of return through parameter at position |
/** | ||
* Gets the MaD string represention of the the return node `node`. | ||
* Gets the MaD string represention of return through parameter at position |
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.
* Gets the MaD string represention of return through parameter at position | |
* Gets the MaD string representation of return through parameter at position |
--- | ||
category: minorAnalysis | ||
--- | ||
* The data flow library now adds intermediate nodes when data flows out of a function via a parameter, in order to make path explanations easier to follow. The intermediate nodes have the same location as the underlying parameter, but must be accessed via `PathNode.asParameterReturnNode` instead of `PathNode.asNode`. `@kind path-problem` queries may have their expected test-output changed as a consequence. |
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.
I don't think we usually comment on the latter aspect.
* The data flow library now adds intermediate nodes when data flows out of a function via a parameter, in order to make path explanations easier to follow. The intermediate nodes have the same location as the underlying parameter, but must be accessed via `PathNode.asParameterReturnNode` instead of `PathNode.asNode`. `@kind path-problem` queries may have their expected test-output changed as a consequence. | |
* The data flow library now adds intermediate nodes when data flows out of a function via a parameter, in order to make path explanations easier to follow. The intermediate nodes have the same location as the underlying parameter, but must be accessed via `PathNode.asParameterReturnNode` instead of `PathNode.asNode`. |
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.
LGTM
This PR adds synthetic return nodes for flow that returns from methods via a parameter. For example, in
we would previously have a direct flow step from
[post] c
at (2) to[post] c
at (3), whereas now we first have a step from[post] c
at (2) toc [Return]
at (1), and then fromc [Return]
at (1) to[post] c
at (3).The motivation for adding the extra node is two-fold: Firstly, it may help with generating fewer
subpaths
, and secondly it will be easier to follow flow path explanations (especially when the parameter write happens in a large method).