@@ -93,6 +93,9 @@ module MakeImpl<InputSig Lang> {
9393 */
9494 int fieldFlowBranchLimit ( ) ;
9595
96+ /** Gets the access path limit. */
97+ int accessPathLimit ( ) ;
98+
9699 /**
97100 * Gets a data flow configuration feature to add restrictions to the set of
98101 * valid flow paths.
@@ -1328,6 +1331,13 @@ module MakeImpl<InputSig Lang> {
13281331 fwdFlow1 ( _, _, _, _, _, _, t0 , t , ap , _) and t0 != t
13291332 }
13301333
1334+ bindingset [ c, t, tail]
1335+ additional Ap apCons ( Content c , Typ t , Ap tail ) {
1336+ result = Param:: apCons ( c , t , tail ) and
1337+ Config:: accessPathLimit ( ) > 0 and
1338+ if tail instanceof ApNil then any ( ) else Config:: accessPathLimit ( ) > 1
1339+ }
1340+
13311341 pragma [ nomagic]
13321342 private predicate fwdFlow0 (
13331343 NodeEx node , FlowState state , Cc cc , ParamNodeOption summaryCtx , TypOption argT ,
@@ -3026,11 +3036,11 @@ module MakeImpl<InputSig Lang> {
30263036 } or
30273037 TConsCons ( Content c1 , DataFlowType t , Content c2 , int len ) {
30283038 Stage4:: consCand ( c1 , t , TFrontHead ( c2 ) ) and
3029- len in [ 2 .. accessPathLimit ( ) ] and
3039+ len in [ 2 .. Config :: accessPathLimit ( ) ] and
30303040 not expensiveLen2unfolding ( c1 )
30313041 } or
30323042 TCons1 ( Content c , int len ) {
3033- len in [ 1 .. accessPathLimit ( ) ] and
3043+ len in [ 1 .. Config :: accessPathLimit ( ) ] and
30343044 expensiveLen2unfolding ( c )
30353045 }
30363046
@@ -3189,7 +3199,10 @@ module MakeImpl<InputSig Lang> {
31893199 Typ getTyp ( DataFlowType t ) { result = t }
31903200
31913201 bindingset [ c, t, tail]
3192- Ap apCons ( Content c , Typ t , Ap tail ) { result .isCons ( c , t , tail ) }
3202+ Ap apCons ( Content c , Typ t , Ap tail ) {
3203+ result .isCons ( c , t , tail ) and
3204+ Config:: accessPathLimit ( ) > tail .len ( )
3205+ }
31933206
31943207 class ApHeadContent = Content ;
31953208
0 commit comments