@@ -8,131 +8,32 @@ private import internal.FlowSummaryImpl as Impl
8
8
private import internal.DataFlowDispatch
9
9
private import internal.DataFlowImplCommon as DataFlowImplCommon
10
10
private import internal.DataFlowPrivate
11
- private import internal.FlowSummaryImplSpecific
12
11
13
12
// import all instances below
14
13
private module Summaries {
15
14
private import codeql.ruby.Frameworks
16
15
private import codeql.ruby.frameworks.data.ModelsAsData
17
16
}
18
17
19
- class SummaryComponent = Impl:: Public :: SummaryComponent ;
18
+ deprecated class SummaryComponent = Impl:: Private :: SummaryComponent ;
20
19
21
- /** Provides predicates for constructing summary components. */
22
- module SummaryComponent {
23
- private import Impl:: Public:: SummaryComponent as SC
20
+ deprecated module SummaryComponent = Impl:: Private:: SummaryComponent;
24
21
25
- predicate parameter = SC :: parameter / 1 ;
22
+ deprecated class SummaryComponentStack = Impl :: Private :: SummaryComponentStack ;
26
23
27
- predicate argument = SC:: argument / 1 ;
28
-
29
- predicate content = SC:: content / 1 ;
30
-
31
- predicate withoutContent = SC:: withoutContent / 1 ;
32
-
33
- predicate withContent = SC:: withContent / 1 ;
34
-
35
- class SyntheticGlobal = SC:: SyntheticGlobal ;
36
-
37
- /** Gets a summary component that represents a receiver. */
38
- SummaryComponent receiver ( ) { result = argument ( any ( ParameterPosition pos | pos .isSelf ( ) ) ) }
39
-
40
- /** Gets a summary component that represents a block argument. */
41
- SummaryComponent block ( ) { result = argument ( any ( ParameterPosition pos | pos .isBlock ( ) ) ) }
42
-
43
- /** Gets a summary component that represents an element in a collection at an unknown index. */
44
- SummaryComponent elementUnknown ( ) {
45
- result = SC:: content ( TSingletonContent ( TUnknownElementContent ( ) ) )
46
- }
47
-
48
- /** Gets a summary component that represents an element in a collection at a known index. */
49
- SummaryComponent elementKnown ( ConstantValue cv ) {
50
- result = SC:: content ( TSingletonContent ( DataFlow:: Content:: getElementContent ( cv ) ) )
51
- }
52
-
53
- /**
54
- * Gets a summary component that represents an element in a collection at a specific
55
- * known index `cv`, or an unknown index.
56
- */
57
- SummaryComponent elementKnownOrUnknown ( ConstantValue cv ) {
58
- result = SC:: content ( TKnownOrUnknownElementContent ( TKnownElementContent ( cv ) ) )
59
- or
60
- not exists ( TKnownElementContent ( cv ) ) and
61
- result = elementUnknown ( )
62
- }
63
-
64
- /**
65
- * Gets a summary component that represents an element in a collection at either an unknown
66
- * index or known index. This has the same semantics as
67
- *
68
- * ```ql
69
- * elementKnown() or elementUnknown(_)
70
- * ```
71
- *
72
- * but is more efficient, because it is represented by a single value.
73
- */
74
- SummaryComponent elementAny ( ) { result = SC:: content ( TAnyElementContent ( ) ) }
75
-
76
- /**
77
- * Gets a summary component that represents an element in a collection at known
78
- * integer index `lower` or above.
79
- */
80
- SummaryComponent elementLowerBound ( int lower ) {
81
- result = SC:: content ( TElementLowerBoundContent ( lower , false ) )
82
- }
83
-
84
- /**
85
- * Gets a summary component that represents an element in a collection at known
86
- * integer index `lower` or above, or possibly at an unknown index.
87
- */
88
- SummaryComponent elementLowerBoundOrUnknown ( int lower ) {
89
- result = SC:: content ( TElementLowerBoundContent ( lower , true ) )
90
- }
91
-
92
- /** Gets a summary component that represents the return value of a call. */
93
- SummaryComponent return ( ) { result = SC:: return ( any ( NormalReturnKind rk ) ) }
94
- }
95
-
96
- class SummaryComponentStack = Impl:: Public:: SummaryComponentStack ;
97
-
98
- /** Provides predicates for constructing stacks of summary components. */
99
- module SummaryComponentStack {
100
- private import Impl:: Public:: SummaryComponentStack as SCS
101
-
102
- predicate singleton = SCS:: singleton / 1 ;
103
-
104
- predicate push = SCS:: push / 2 ;
105
-
106
- predicate argument = SCS:: argument / 1 ;
107
-
108
- /** Gets a singleton stack representing a receiver. */
109
- SummaryComponentStack receiver ( ) { result = singleton ( SummaryComponent:: receiver ( ) ) }
110
-
111
- /** Gets a singleton stack representing a block argument. */
112
- SummaryComponentStack block ( ) { result = singleton ( SummaryComponent:: block ( ) ) }
113
-
114
- /** Gets a singleton stack representing the return value of a call. */
115
- SummaryComponentStack return ( ) { result = singleton ( SummaryComponent:: return ( ) ) }
116
- }
24
+ deprecated module SummaryComponentStack = Impl:: Private:: SummaryComponentStack;
117
25
118
26
/** A callable with a flow summary, identified by a unique string. */
119
27
abstract class SummarizedCallable extends LibraryCallable , Impl:: Public:: SummarizedCallable {
120
28
bindingset [ this ]
121
29
SummarizedCallable ( ) { any ( ) }
122
30
123
31
/**
124
- * Same as
125
- *
126
- * ```ql
127
- * propagatesFlow(
128
- * SummaryComponentStack input, SummaryComponentStack output, boolean preservesValue
129
- * )
130
- * ```
131
- *
132
- * but uses an external (string) representation of the input and output stacks.
32
+ * DEPRECATED: Use `propagatesFlow` instead.
133
33
*/
134
- pragma [ nomagic]
135
- predicate propagatesFlowExt ( string input , string output , boolean preservesValue ) { none ( ) }
34
+ deprecated predicate propagatesFlowExt ( string input , string output , boolean preservesValue ) {
35
+ this .propagatesFlow ( input , output , preservesValue )
36
+ }
136
37
137
38
/**
138
39
* Gets the synthesized parameter that results from an input specification
@@ -141,7 +42,7 @@ abstract class SummarizedCallable extends LibraryCallable, Impl::Public::Summari
141
42
DataFlow:: ParameterNode getParameter ( string s ) {
142
43
exists ( ParameterPosition pos |
143
44
DataFlowImplCommon:: parameterNode ( result , TLibraryCallable ( this ) , pos ) and
144
- s = getParameterPosition ( pos )
45
+ s = Impl :: Input :: encodeParameterPosition ( pos )
145
46
)
146
47
}
147
48
}
@@ -159,7 +60,7 @@ abstract class SimpleSummarizedCallable extends SummarizedCallable {
159
60
final override MethodCall getACallSimple ( ) { result = mc }
160
61
}
161
62
162
- class RequiredSummaryComponentStack = Impl:: Public :: RequiredSummaryComponentStack ;
63
+ deprecated class RequiredSummaryComponentStack = Impl:: Private :: RequiredSummaryComponentStack ;
163
64
164
65
/**
165
66
* Provides a set of special flow summaries to ensure that callbacks passed into
@@ -199,7 +100,7 @@ private module LibraryCallbackSummaries {
199
100
libraryCallHasLambdaArg ( result .getAControlFlowNode ( ) , _)
200
101
}
201
102
202
- override predicate propagatesFlowExt ( string input , string output , boolean preservesValue ) {
103
+ override predicate propagatesFlow ( string input , string output , boolean preservesValue ) {
203
104
(
204
105
input = "Argument[block]" and
205
106
output = "Argument[block].Parameter[lambda-self]"
0 commit comments