About FlowState in C/C++ DataFlow analysis #13390
-
After reading Java's doc about Flow Label which is pretty much like "FlowState" in C/C++ https://codeql.github.com/docs/codeql-language-guides/using-flow-labels-for-precise-data-flow-analysis/, a C/C++ example in issue #13198 , a python example in discussion #12797 , and some ql-module library source, I think I've got some basic usage of "FlowState". But there are still confusions. According to my knowledge so far, Like this:
I am curious about the middle of the path.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What's actually tracked in the middle of the path is a tuple of the DataFlow::Node, the flow state, and some additional call and field context, and the flow state can be modified partway through the path with an appropriate override of |
Beta Was this translation helpful? Give feedback.
What's actually tracked in the middle of the path is a tuple of the DataFlow::Node, the flow state, and some additional call and field context, and the flow state can be modified partway through the path with an appropriate override of
hasAdditionalFlowStep
. There's multiple pruning stages that progressively add that information, to avoid tracking too much in the early stages. What will happen is that the path from source1 to sink3 will be eliminated in the stage that adds the flow state into the tuple, but not before that. If you have two sets of sources and sinks that you know shouldn't interact, you're likely to be better off from a performance perspective by writing multiple data flow…