mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Python: Add getPostUpdateNode to DataFlow::Node
as discussed in https://github.com/github/codeql/pull/5864#discussion_r634675940
This commit is contained in:
@@ -19,7 +19,7 @@ module syntheticPreUpdateNode {
|
||||
SyntheticPreUpdateNode() { this = TSyntheticPreUpdateNode(post) }
|
||||
|
||||
/** Gets the node for which this is a synthetic pre-update node. */
|
||||
Node getPostUpdateNode() { result = post }
|
||||
override NeedsSyntheticPreUpdateNode getPostUpdateNode() { result = post }
|
||||
|
||||
override string toString() { result = "[pre " + post.label() + "] " + post.toString() }
|
||||
|
||||
|
||||
@@ -123,6 +123,9 @@ class Node extends TNode {
|
||||
* Gets a local source node from which data may flow to this node in zero or more local data-flow steps.
|
||||
*/
|
||||
LocalSourceNode getALocalSource() { result.flowsTo(this) }
|
||||
|
||||
/** Gets the `PostUpdateNode` for this node, if any. */
|
||||
PostUpdateNode getPostUpdateNode() { result.getPreUpdateNode() = this }
|
||||
}
|
||||
|
||||
/** A data-flow node corresponding to an SSA variable. */
|
||||
|
||||
Reference in New Issue
Block a user