@@ -21,7 +21,6 @@ predicate multipleCallsToSuperclassMethod(
21
21
}
22
22
23
23
/** Holds if l1 comes before l2, assuming they're in the same file. */
24
- pragma [ inline]
25
24
private predicate locationBefore ( Location l1 , Location l2 ) {
26
25
l1 .getStartLine ( ) < l2 .getStartLine ( )
27
26
or
@@ -45,7 +44,6 @@ Function getDirectSuperCallTargetFromCall(
45
44
Class mroBase , Function meth , DataFlow:: MethodCallNode call , string name
46
45
) {
47
46
meth = call .getScope ( ) and
48
- getADirectSuperclass * ( mroBase ) = meth .getScope ( ) and
49
47
meth .getName ( ) = name and
50
48
call .calls ( _, name ) and
51
49
mroBase = getADirectSubclass * ( meth .getScope ( ) ) and
@@ -56,7 +54,7 @@ Function getDirectSuperCallTargetFromCall(
56
54
result = findFunctionAccordingToMroKnownStartingClass ( targetCls , mroBase , name )
57
55
or
58
56
// targetCls is the mro base for this lookup.
59
- // note however that if the call we find uses super(), that still uses the mro of the instance `self` will sill be used
57
+ // note however that if the call we find uses super(), that still uses the mro of the instance `self`
60
58
// assuming it's 0-arg or is 2-arg with `self` as second arg.
61
59
callsMethodOnClassWithSelf ( meth , call , targetCls , _) and
62
60
result = findFunctionAccordingToMroKnownStartingClass ( targetCls , targetCls , name )
@@ -96,7 +94,7 @@ predicate superCall(DataFlow::MethodCallNode call, string name) {
96
94
)
97
95
}
98
96
99
- /** Holds if `meth` calls `super().<name>` where `name` is the name of the method . */
97
+ /** Holds if `meth` calls a `super()` method of the same name . */
100
98
predicate callsSuper ( Function meth ) {
101
99
exists ( DataFlow:: MethodCallNode call |
102
100
call .getScope ( ) = meth and
@@ -122,7 +120,7 @@ predicate callsMethodOnUnknownClassWithSelf(Function meth, string name) {
122
120
call .calls ( callTarget , name ) and
123
121
self .getParameter ( ) = meth .getArg ( 0 ) and
124
122
self .( DataFlow:: LocalSourceNode ) .flowsTo ( call .getArg ( 0 ) ) and
125
- not exists ( Class target | callTarget = classTracker ( target ) )
123
+ not callTarget = classTracker ( any ( Class target ) )
126
124
)
127
125
}
128
126
0 commit comments