1
1
private import codeql.dataflow.DataFlow
2
2
private import codeql.typetracking.TypeTracking as Tt
3
+ private import codeql.util.Unit
3
4
4
5
module MakeImplCommon< InputSig Lang> {
5
6
private import Lang
@@ -54,7 +55,10 @@ module MakeImplCommon<InputSig Lang> {
54
55
override string toString ( ) { result = "FeatureEqualSourceSinkCallContext" }
55
56
}
56
57
57
- signature predicate sourceNode ( Node n ) ;
58
+ /**
59
+ * Holds if `source` is a relevant data flow source.
60
+ */
61
+ signature predicate sourceNode ( Node source ) ;
58
62
59
63
/**
60
64
* EXPERIMENTAL: This API is subject to change without notice.
@@ -86,8 +90,8 @@ module MakeImplCommon<InputSig Lang> {
86
90
string toString ( ) { result = "Content" }
87
91
}
88
92
89
- class ContentFilter extends Content {
90
- Content getAMatchingContent ( ) { result = this }
93
+ class ContentFilter extends Unit {
94
+ Content getAMatchingContent ( ) { none ( ) }
91
95
}
92
96
93
97
predicate compatibleContents ( Content storeContents , Content loadContents ) {
@@ -102,6 +106,7 @@ module MakeImplCommon<InputSig Lang> {
102
106
argumentValueFlowsThrough ( n1 , TReadStepTypesNone ( ) , n2 )
103
107
}
104
108
109
+ // TODO: support setters
105
110
predicate storeStep ( Node n1 , Node n2 , Content f ) { storeSet ( n1 , f , n2 , _, _) }
106
111
107
112
predicate loadStep ( Node n1 , LocalSourceNode n2 , Content f ) {
@@ -720,7 +725,7 @@ module MakeImplCommon<InputSig Lang> {
720
725
* If a read step was taken, then `read` captures the `Content`, the
721
726
* container type, and the content type.
722
727
*/
723
- pragma [ nomagic ]
728
+ cached
724
729
predicate argumentValueFlowsThrough ( ArgNode arg , ReadStepTypesOption read , Node out ) {
725
730
exists ( DataFlowCall call , ReturnKind kind |
726
731
argumentValueFlowsThrough0 ( call , arg , kind , read ) and
0 commit comments