@@ -21,7 +21,6 @@ predicate multipleCallsToSuperclassMethod(
2121}
2222
2323/** Holds if l1 comes before l2, assuming they're in the same file. */
24- pragma [ inline]
2524private predicate locationBefore ( Location l1 , Location l2 ) {
2625 l1 .getStartLine ( ) < l2 .getStartLine ( )
2726 or
@@ -45,7 +44,6 @@ Function getDirectSuperCallTargetFromCall(
4544 Class mroBase , Function meth , DataFlow:: MethodCallNode call , string name
4645) {
4746 meth = call .getScope ( ) and
48- getADirectSuperclass * ( mroBase ) = meth .getScope ( ) and
4947 meth .getName ( ) = name and
5048 call .calls ( _, name ) and
5149 mroBase = getADirectSubclass * ( meth .getScope ( ) ) and
@@ -56,7 +54,7 @@ Function getDirectSuperCallTargetFromCall(
5654 result = findFunctionAccordingToMroKnownStartingClass ( targetCls , mroBase , name )
5755 or
5856 // 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`
6058 // assuming it's 0-arg or is 2-arg with `self` as second arg.
6159 callsMethodOnClassWithSelf ( meth , call , targetCls , _) and
6260 result = findFunctionAccordingToMroKnownStartingClass ( targetCls , targetCls , name )
@@ -96,7 +94,7 @@ predicate superCall(DataFlow::MethodCallNode call, string name) {
9694 )
9795}
9896
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 . */
10098predicate callsSuper ( Function meth ) {
10199 exists ( DataFlow:: MethodCallNode call |
102100 call .getScope ( ) = meth and
@@ -122,7 +120,7 @@ predicate callsMethodOnUnknownClassWithSelf(Function meth, string name) {
122120 call .calls ( callTarget , name ) and
123121 self .getParameter ( ) = meth .getArg ( 0 ) and
124122 self .( DataFlow:: LocalSourceNode ) .flowsTo ( call .getArg ( 0 ) ) and
125- not exists ( Class target | callTarget = classTracker ( target ) )
123+ not callTarget = classTracker ( any ( Class target ) )
126124 )
127125}
128126
0 commit comments