@@ -45,7 +45,6 @@ Function getDirectSuperCallTargetFromCall(
4545 Class mroBase , Function meth , DataFlow:: MethodCallNode call , string name
4646) {
4747 meth = call .getScope ( ) and
48- getADirectSuperclass * ( mroBase ) = meth .getScope ( ) and
4948 meth .getName ( ) = name and
5049 call .calls ( _, name ) and
5150 mroBase = getADirectSubclass * ( meth .getScope ( ) ) and
@@ -56,7 +55,7 @@ Function getDirectSuperCallTargetFromCall(
5655 result = findFunctionAccordingToMroKnownStartingClass ( targetCls , mroBase , name )
5756 or
5857 // 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
58+ // note however that if the call we find uses super(), that still uses the mro of the instance `self`
6059 // assuming it's 0-arg or is 2-arg with `self` as second arg.
6160 callsMethodOnClassWithSelf ( meth , call , targetCls , _) and
6261 result = findFunctionAccordingToMroKnownStartingClass ( targetCls , targetCls , name )
@@ -96,7 +95,7 @@ predicate superCall(DataFlow::MethodCallNode call, string name) {
9695 )
9796}
9897
99- /** Holds if `meth` calls `super().<name>` where `name` is the name of the method . */
98+ /** Holds if `meth` calls a `super()` method of the same name . */
10099predicate callsSuper ( Function meth ) {
101100 exists ( DataFlow:: MethodCallNode call |
102101 call .getScope ( ) = meth and
@@ -122,7 +121,7 @@ predicate callsMethodOnUnknownClassWithSelf(Function meth, string name) {
122121 call .calls ( callTarget , name ) and
123122 self .getParameter ( ) = meth .getArg ( 0 ) and
124123 self .( DataFlow:: LocalSourceNode ) .flowsTo ( call .getArg ( 0 ) ) and
125- not exists ( Class target | callTarget = classTracker ( target ) )
124+ not callTarget = classTracker ( any ( Class target ) )
126125 )
127126}
128127
0 commit comments