Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements field-based dataflow (i.e., "field flow") for Powershell.
Field flow is what allows us to get flow in examples such as:
While it may look innocent, field flow is extremely powerful, and extremely hard to get to perform well. Luckily, all the complications are hidden away inside the shared dataflow library, so all we need to do is:
DataFlow::Node
s to represent the notion of "a dataflow node where we have just stored data into". These nodes are known as "post-update nodes".storeStep
.readStep
.Consider an example such as:
operationally, what happens is that:
storeStep
fromSource
to the post-update node for$x
(which is printed as[post] $x
). Internally, the data flow "remembers" that there has been a write tof
when it generatesPathNode
s (that's the part that's extremely hard to get to perform well). When viewing paths, this will be printed as something like[post] $x [f]
. The[f]
part is known as the "access path" and can contain up to 5 entries (which represents tracking a value that's been stored into 5 nested structs/classes).[post] $x
on line 1 to$x
on line 2 (we get this from SSA).$x
to$y
readStep
from$y
to$y.f
that reads fromy
. Because the dataflow library "remembers" that there was a previous write tof
it will "pop off"f
from the access path.