@@ -191,13 +191,7 @@ private predicate moduleFlowsToMethodCallReceiver(RelevantCall call, Module m, s
191191 flowsToMethodCallReceiver ( call , trackModuleAccess ( m ) , method )
192192}
193193
194- private Block yieldCall ( RelevantCall call ) {
195- call .getExpr ( ) instanceof YieldCall and
196- exists ( BlockParameterNode node |
197- node = trackBlock ( result ) and
198- node .getMethod ( ) = call .getExpr ( ) .getEnclosingMethod ( )
199- )
200- }
194+ private Block blockCall ( RelevantCall call ) { lambdaSourceCall ( call , _, trackBlock ( result ) ) }
201195
202196pragma [ nomagic]
203197private predicate superCall ( RelevantCall call , Module cls , string method ) {
@@ -297,7 +291,7 @@ predicate isUserDefinedNew(SingletonMethod new) {
297291
298292private Callable viableSourceCallableNonInit ( RelevantCall call ) {
299293 result = getTarget ( call ) and
300- not call . getExpr ( ) instanceof YieldCall // handled by `lambdaCreation`/`lambdaCall`
294+ not result = blockCall ( call ) // handled by `lambdaCreation`/`lambdaCall`
301295}
302296
303297private Callable viableSourceCallableInit ( RelevantCall call ) { result = getInitializeTarget ( call ) }
@@ -394,7 +388,7 @@ private module Cached {
394388 result = lookupMethod ( cls .getAnImmediateAncestor ( ) , method )
395389 )
396390 or
397- result = yieldCall ( call )
391+ result = blockCall ( call )
398392 }
399393
400394 /** Gets a viable run-time target for the call `call`. */
@@ -700,13 +694,19 @@ private DataFlow::LocalSourceNode trackBlock(Block block, TypeTracker t) {
700694 t .start ( ) and result .asExpr ( ) .getExpr ( ) = block
701695 or
702696 exists ( TypeTracker t2 , StepSummary summary |
703- result = trackBlockRec ( block , t2 , summary ) and t = t2 .append ( summary )
697+ result = trackBlockRec ( block , t2 , summary ) and
698+ t = t2 .append ( summary )
704699 )
705700}
706701
702+ /**
703+ * We exclude steps into `self` parameters, which may happen when the code
704+ * base contains implementations of `call`.
705+ */
707706pragma [ nomagic]
708707private DataFlow:: LocalSourceNode trackBlockRec ( Block block , TypeTracker t , StepSummary summary ) {
709- StepSummary:: step ( trackBlock ( block , t ) , result , summary )
708+ StepSummary:: step ( trackBlock ( block , t ) , result , summary ) and
709+ not result instanceof SelfParameterNode
710710}
711711
712712pragma [ nomagic]
0 commit comments