@@ -106,7 +106,7 @@ private predicate instanceFieldAssign(Expr src, FieldAccess fa) {
106
106
* Thus, `node2` references an object with a field `f` that contains the
107
107
* value of `node1`.
108
108
*/
109
- predicate storeStep ( Node node1 , Content f , Node node2 ) {
109
+ predicate storeStep ( Node node1 , ContentSet f , Node node2 ) {
110
110
exists ( FieldAccess fa |
111
111
instanceFieldAssign ( node1 .asExpr ( ) , fa ) and
112
112
node2 .( PostUpdateNode ) .getPreUpdateNode ( ) = getFieldQualifier ( fa ) and
@@ -124,7 +124,7 @@ predicate storeStep(Node node1, Content f, Node node2) {
124
124
* Thus, `node1` references an object with a field `f` whose value ends up in
125
125
* `node2`.
126
126
*/
127
- predicate readStep ( Node node1 , Content f , Node node2 ) {
127
+ predicate readStep ( Node node1 , ContentSet f , Node node2 ) {
128
128
exists ( FieldRead fr |
129
129
node1 = getFieldQualifier ( fr ) and
130
130
fr .getField ( ) = f .( FieldContent ) .getField ( ) and
@@ -156,7 +156,7 @@ predicate readStep(Node node1, Content f, Node node2) {
156
156
* any value stored inside `f` is cleared at the pre-update node associated with `x`
157
157
* in `x.f = newValue`.
158
158
*/
159
- predicate clearsContent ( Node n , Content c ) {
159
+ predicate clearsContent ( Node n , ContentSet c ) {
160
160
exists ( FieldAccess fa |
161
161
instanceFieldAssign ( _, fa ) and
162
162
n = getFieldQualifier ( fa ) and
@@ -207,47 +207,25 @@ DataFlowType getNodeType(Node n) {
207
207
}
208
208
209
209
/** Gets a string representation of a type returned by `getErasedRepr`. */
210
- string ppReprType ( Type t ) {
210
+ string ppReprType ( DataFlowType t ) {
211
211
if t .( BoxedType ) .getPrimitiveType ( ) .getName ( ) = "double"
212
212
then result = "Number"
213
213
else result = t .toString ( )
214
214
}
215
215
216
- private predicate canContainBool ( Type t ) {
217
- t instanceof BooleanType or
218
- any ( BooleanType b ) .( RefType ) .getASourceSupertype + ( ) = t
219
- }
220
-
221
216
/**
222
217
* Holds if `t1` and `t2` are compatible, that is, whether data can flow from
223
218
* a node of type `t1` to a node of type `t2`.
224
219
*/
225
- pragma [ inline]
226
- predicate compatibleTypes ( Type t1 , Type t2 ) {
227
- exists ( Type e1 , Type e2 |
228
- e1 = getErasedRepr ( t1 ) and
229
- e2 = getErasedRepr ( t2 )
230
- |
231
- // Because of `getErasedRepr`, `erasedHaveIntersection` is a sufficient
232
- // compatibility check, but `conContainBool` is kept as a dummy disjunct
233
- // to get the proper join-order.
234
- erasedHaveIntersection ( e1 , e2 )
235
- or
236
- canContainBool ( e1 ) and canContainBool ( e2 )
237
- )
238
- }
220
+ bindingset [ t1, t2]
221
+ pragma [ inline_late]
222
+ predicate compatibleTypes ( DataFlowType t1 , DataFlowType t2 ) { erasedHaveIntersection ( t1 , t2 ) }
239
223
240
224
/** A node that performs a type cast. */
241
225
class CastNode extends ExprNode {
242
226
CastNode ( ) { this .getExpr ( ) instanceof CastingExpr }
243
227
}
244
228
245
- /**
246
- * Holds if `n` should never be skipped over in the `PathGraph` and in path
247
- * explanations.
248
- */
249
- predicate neverSkipInPathGraph ( Node n ) { none ( ) }
250
-
251
229
private newtype TDataFlowCallable =
252
230
TSrcCallable ( Callable c ) or
253
231
TSummarizedCallable ( SummarizedCallable c ) or
@@ -381,8 +359,6 @@ predicate isUnreachableInCall(Node n, DataFlowCall call) {
381
359
)
382
360
}
383
361
384
- int accessPathLimit ( ) { result = 5 }
385
-
386
362
/**
387
363
* Holds if access paths with `c` at their head always should be tracked at high
388
364
* precision. This disables adaptive access path precision for such access paths.
0 commit comments