@@ -579,6 +579,10 @@ private predicate localFlowStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo,
579579 summary .toString ( ) = "level"
580580}
581581
582+ private predicate hasAdjacentTypeCheckedReads ( DataFlow:: Node node ) {
583+ hasAdjacentTypeCheckedReads ( _, _, node .asExpr ( ) , _)
584+ }
585+
582586/**
583587 * We exclude steps into `self` parameters and type checked variables. For those,
584588 * we instead rely on the type of the enclosing module resp. the type being checked
@@ -588,12 +592,12 @@ private predicate localFlowStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo,
588592pragma [ nomagic]
589593private DataFlow:: Node trackInstanceRec ( Module tp , TypeTracker t , boolean exact , StepSummary summary ) {
590594 exists ( DataFlow:: Node mid | mid = trackInstance ( tp , exact , t ) |
591- StepSummary:: smallstep ( mid , result , summary )
595+ StepSummary:: smallstep ( mid , result , summary ) and
596+ not result instanceof SelfParameterNode
592597 or
593- localFlowStep ( mid , result , summary )
594- ) and
595- not result instanceof SelfParameterNode and
596- not hasAdjacentTypeCheckedReads ( _, _, result .asExpr ( ) , _)
598+ localFlowStep ( mid , result , summary ) and
599+ not hasAdjacentTypeCheckedReads ( result )
600+ )
597601}
598602
599603pragma [ nomagic]
0 commit comments