Dataflow: Add support for flow state.

This commit is contained in:
Anders Schack-Mulligen
2021-11-15 14:54:26 +01:00
parent 38d0bb4a60
commit 219bf51ec2
2 changed files with 1063 additions and 568 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,25 @@ private import DataFlowImplSpecific::Public
import Cached
module DataFlowImplCommonPublic {
/** A state value to track during data flow. */
abstract class FlowState extends string {
bindingset[this]
FlowState() { any() }
}
/**
* The default state, which is used when the state is unspecified for a source
* or a sink.
*/
class FlowStateEmpty extends FlowState {
FlowStateEmpty() { this = "" }
}
// Dummy value to avoid misoptimizations when FlowState has size 1.
private class FlowStateDummy extends FlowState {
FlowStateDummy() { this = "dummy" }
}
private newtype TFlowFeature =
TFeatureHasSourceCallContext() or
TFeatureHasSinkCallContext() or