@@ -579,6 +579,10 @@ private predicate localFlowStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo,
579
579
summary .toString ( ) = "level"
580
580
}
581
581
582
+ private predicate hasAdjacentTypeCheckedReads ( DataFlow:: Node node ) {
583
+ hasAdjacentTypeCheckedReads ( _, _, node .asExpr ( ) , _)
584
+ }
585
+
582
586
/**
583
587
* We exclude steps into `self` parameters and type checked variables. For those,
584
588
* 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,
588
592
pragma [ nomagic]
589
593
private DataFlow:: Node trackInstanceRec ( Module tp , TypeTracker t , boolean exact , StepSummary summary ) {
590
594
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
592
597
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
+ )
597
601
}
598
602
599
603
pragma [ nomagic]
0 commit comments