@@ -571,15 +571,7 @@ module MakeModelGenerator<
571
571
}
572
572
573
573
private string getContent ( PropagateContentFlow:: AccessPath ap , int i ) {
574
- exists ( DataFlow:: ContentSet head , PropagateContentFlow:: AccessPath tail |
575
- head = ap .getHead ( ) and
576
- tail = ap .getTail ( )
577
- |
578
- i = 0 and
579
- result = "." + printContent ( head )
580
- or
581
- i > 0 and result = getContent ( tail , i - 1 )
582
- )
574
+ result = "." + printContent ( ap .getAtIndex ( i ) )
583
575
}
584
576
585
577
/**
@@ -600,12 +592,7 @@ module MakeModelGenerator<
600
592
* Holds if the access path `ap` contains a field or synthetic field access.
601
593
*/
602
594
private predicate mentionsField ( PropagateContentFlow:: AccessPath ap ) {
603
- exists ( DataFlow:: ContentSet head , PropagateContentFlow:: AccessPath tail |
604
- head = ap .getHead ( ) and
605
- tail = ap .getTail ( )
606
- |
607
- mentionsField ( tail ) or isField ( head )
608
- )
595
+ isField ( ap .getAtIndex ( _) )
609
596
}
610
597
611
598
private predicate apiFlow (
@@ -668,21 +655,19 @@ module MakeModelGenerator<
668
655
* Holds if any of the content sets in `path` translates into a synthetic field.
669
656
*/
670
657
private predicate hasSyntheticContent ( PropagateContentFlow:: AccessPath path ) {
671
- exists ( PropagateContentFlow:: AccessPath tail , DataFlow:: ContentSet head |
672
- head = path .getHead ( ) and
673
- tail = path .getTail ( )
674
- |
675
- exists ( getSyntheticName ( head ) ) or
676
- hasSyntheticContent ( tail )
677
- )
658
+ exists ( getSyntheticName ( path .getAtIndex ( _) ) )
659
+ }
660
+
661
+ private string getHashAtIndex ( PropagateContentFlow:: AccessPath ap , int i ) {
662
+ result = getSyntheticName ( ap .getAtIndex ( i ) )
678
663
}
679
664
680
665
private string getReversedHash ( PropagateContentFlow:: AccessPath ap ) {
681
- result = concat ( int i | | getSyntheticName ( ap . getAtIndex ( i ) ) , "" order by i desc )
666
+ result = concat ( int i | | getHashAtIndex ( ap , i ) , "" order by i desc )
682
667
}
683
668
684
669
private string getHash ( PropagateContentFlow:: AccessPath ap ) {
685
- result = concat ( int i | | getSyntheticName ( ap . getAtIndex ( i ) ) , "" order by i )
670
+ result = concat ( int i | | getHashAtIndex ( ap , i ) , "" order by i )
686
671
}
687
672
688
673
/**
0 commit comments