@@ -39,48 +39,52 @@ predicate step(Node n1, Node n2, string s1, string s2) {
39
39
40
40
predicate checkNode ( Node n ) { n .asExpr ( ) .( Argument ) .getCall ( ) .getCallee ( ) .hasName ( "check" ) }
41
41
42
- class Conf extends TaintTracking :: Configuration {
43
- Conf ( ) { this = "qltest:state" }
42
+ module Conf implements DataFlow :: StateConfigSig {
43
+ class FlowState = string ;
44
44
45
- override predicate isSource ( Node n , FlowState s ) { src ( n , s ) }
45
+ predicate isSource ( Node n , FlowState s ) { src ( n , s ) }
46
46
47
- override predicate isSink ( Node n , FlowState s ) { sink ( n , s ) }
47
+ predicate isSink ( Node n , FlowState s ) { sink ( n , s ) }
48
48
49
- override predicate isSanitizer ( Node n , FlowState s ) { bar ( n , s ) }
49
+ predicate isBarrier ( Node n , FlowState s ) { bar ( n , s ) }
50
50
51
- override predicate isAdditionalTaintStep ( Node n1 , FlowState s1 , Node n2 , FlowState s2 ) {
51
+ predicate isAdditionalFlowStep ( Node n1 , FlowState s1 , Node n2 , FlowState s2 ) {
52
52
step ( n1 , n2 , s1 , s2 )
53
53
}
54
-
55
- override int explorationLimit ( ) { result = 0 }
56
54
}
57
55
56
+ int explorationLimit ( ) { result = 0 }
57
+
58
+ module Flow = TaintTracking:: MakeWithState< Conf > ;
59
+
60
+ module PartialFlow = Flow:: FlowExploration< explorationLimit / 0 > ;
61
+
58
62
class HasFlowTest extends InlineExpectationsTest {
59
63
HasFlowTest ( ) { this = "HasFlowTest" }
60
64
61
65
override string getARelevantTag ( ) { result = [ "pFwd" , "pRev" , "flow" ] }
62
66
63
67
override predicate hasActualResult ( Location location , string element , string tag , string value ) {
64
68
tag = "flow" and
65
- exists ( PathNode src , PathNode sink , Conf conf |
66
- conf . hasFlowPath ( src , sink ) and
69
+ exists ( Flow :: PathNode src , Flow :: PathNode sink |
70
+ Flow :: hasFlowPath ( src , sink ) and
67
71
sink .getNode ( ) .getLocation ( ) = location and
68
72
element = sink .toString ( ) and
69
73
value = src .getState ( )
70
74
)
71
75
or
72
76
tag = "pFwd" and
73
- exists ( PartialPathNode src , PartialPathNode node , Conf conf |
74
- conf . hasPartialFlow ( src , node , _) and
77
+ exists ( PartialFlow :: PartialPathNode src , PartialFlow :: PartialPathNode node |
78
+ PartialFlow :: hasPartialFlow ( src , node , _) and
75
79
checkNode ( node .getNode ( ) ) and
76
80
node .getNode ( ) .getLocation ( ) = location and
77
81
element = node .toString ( ) and
78
82
value = src .getState ( ) + "-" + node .getState ( )
79
83
)
80
84
or
81
85
tag = "pRev" and
82
- exists ( PartialPathNode node , PartialPathNode sink , Conf conf |
83
- conf . hasPartialFlowRev ( node , sink , _) and
86
+ exists ( PartialFlow :: PartialPathNode node , PartialFlow :: PartialPathNode sink |
87
+ PartialFlow :: hasPartialFlowRev ( node , sink , _) and
84
88
checkNode ( node .getNode ( ) ) and
85
89
node .getNode ( ) .getLocation ( ) = location and
86
90
element = node .toString ( ) and
0 commit comments