@@ -106,7 +106,7 @@ private predicate instanceFieldAssign(Expr src, FieldAccess fa) {
106106 * Thus, `node2` references an object with a field `f` that contains the
107107 * value of `node1`.
108108 */
109- predicate storeStep ( Node node1 , Content f , Node node2 ) {
109+ predicate storeStep ( Node node1 , ContentSet f , Node node2 ) {
110110 exists ( FieldAccess fa |
111111 instanceFieldAssign ( node1 .asExpr ( ) , fa ) and
112112 node2 .( PostUpdateNode ) .getPreUpdateNode ( ) = getFieldQualifier ( fa ) and
@@ -124,7 +124,7 @@ predicate storeStep(Node node1, Content f, Node node2) {
124124 * Thus, `node1` references an object with a field `f` whose value ends up in
125125 * `node2`.
126126 */
127- predicate readStep ( Node node1 , Content f , Node node2 ) {
127+ predicate readStep ( Node node1 , ContentSet f , Node node2 ) {
128128 exists ( FieldRead fr |
129129 node1 = getFieldQualifier ( fr ) and
130130 fr .getField ( ) = f .( FieldContent ) .getField ( ) and
@@ -156,7 +156,7 @@ predicate readStep(Node node1, Content f, Node node2) {
156156 * any value stored inside `f` is cleared at the pre-update node associated with `x`
157157 * in `x.f = newValue`.
158158 */
159- predicate clearsContent ( Node n , Content c ) {
159+ predicate clearsContent ( Node n , ContentSet c ) {
160160 exists ( FieldAccess fa |
161161 instanceFieldAssign ( _, fa ) and
162162 n = getFieldQualifier ( fa ) and
@@ -207,47 +207,25 @@ DataFlowType getNodeType(Node n) {
207207}
208208
209209/** Gets a string representation of a type returned by `getErasedRepr`. */
210- string ppReprType ( Type t ) {
210+ string ppReprType ( DataFlowType t ) {
211211 if t .( BoxedType ) .getPrimitiveType ( ) .getName ( ) = "double"
212212 then result = "Number"
213213 else result = t .toString ( )
214214}
215215
216- private predicate canContainBool ( Type t ) {
217- t instanceof BooleanType or
218- any ( BooleanType b ) .( RefType ) .getASourceSupertype + ( ) = t
219- }
220-
221216/**
222217 * Holds if `t1` and `t2` are compatible, that is, whether data can flow from
223218 * a node of type `t1` to a node of type `t2`.
224219 */
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 ) }
239223
240224/** A node that performs a type cast. */
241225class CastNode extends ExprNode {
242226 CastNode ( ) { this .getExpr ( ) instanceof CastingExpr }
243227}
244228
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-
251229private newtype TDataFlowCallable =
252230 TSrcCallable ( Callable c ) or
253231 TSummarizedCallable ( SummarizedCallable c ) or
@@ -381,8 +359,6 @@ predicate isUnreachableInCall(Node n, DataFlowCall call) {
381359 )
382360}
383361
384- int accessPathLimit ( ) { result = 5 }
385-
386362/**
387363 * Holds if access paths with `c` at their head always should be tracked at high
388364 * precision. This disables adaptive access path precision for such access paths.
0 commit comments