@@ -90,16 +90,28 @@ private module Cached {
90
90
)
91
91
}
92
92
93
+ pragma [ nomagic]
94
+ private ClassPredicate getClassPredicate ( Class c , string name , int arity ) {
95
+ result = c .getClassPredicate ( name ) and
96
+ arity = result .getArity ( )
97
+ }
98
+
99
+ pragma [ nomagic]
100
+ private predicate resolveSelfClassCalls0 ( Class c , string name , int arity , MemberCall mc ) {
101
+ mc .getBase ( ) instanceof ThisAccess and
102
+ c = mc .getEnclosingPredicate ( ) .getParent ( ) and
103
+ name = mc .getMemberName ( ) and
104
+ arity = mc .getNumberOfArguments ( )
105
+ }
106
+
93
107
/**
94
108
* Holds if `mc` is a `this.method()` call to a predicate defined in the same class.
95
109
* helps avoid spuriously resolving to predicates in super-classes.
96
110
*/
97
111
private predicate resolveSelfClassCalls ( MemberCall mc , PredicateOrBuiltin p ) {
98
- exists ( Class c |
99
- mc .getBase ( ) instanceof ThisAccess and
100
- c = mc .getEnclosingPredicate ( ) .getParent ( ) and
101
- p = c .getClassPredicate ( mc .getMemberName ( ) ) and
102
- p .getArity ( ) = mc .getNumberOfArguments ( )
112
+ exists ( Class c , string name , int arity |
113
+ resolveSelfClassCalls0 ( c , name , arity , mc ) and
114
+ p = getClassPredicate ( c , name , arity )
103
115
)
104
116
}
105
117
0 commit comments