@@ -1673,10 +1673,24 @@ private module Stage2 {
1673
1673
storeStepFwd ( _, ap , tc , _, _, config )
1674
1674
}
1675
1675
1676
- predicate consCand ( TypedContent tc , Ap ap , Configuration config ) {
1676
+ private predicate revConsCand ( TypedContent tc , Ap ap , Configuration config ) {
1677
1677
storeStepCand ( _, ap , tc , _, _, config )
1678
1678
}
1679
1679
1680
+ private predicate validAp ( Ap ap , Configuration config ) {
1681
+ revFlow ( _, _, _, _, ap , config ) and ap instanceof ApNil
1682
+ or
1683
+ exists ( TypedContent head , Ap tail |
1684
+ consCand ( head , tail , config ) and
1685
+ ap = apCons ( head , tail )
1686
+ )
1687
+ }
1688
+
1689
+ predicate consCand ( TypedContent tc , Ap ap , Configuration config ) {
1690
+ revConsCand ( tc , ap , config ) and
1691
+ validAp ( ap , config )
1692
+ }
1693
+
1680
1694
pragma [ noinline]
1681
1695
private predicate parameterFlow (
1682
1696
ParamNodeEx p , Ap ap , Ap ap0 , DataFlowCallable c , Configuration config
@@ -2495,10 +2509,24 @@ private module Stage3 {
2495
2509
storeStepFwd ( _, ap , tc , _, _, config )
2496
2510
}
2497
2511
2498
- predicate consCand ( TypedContent tc , Ap ap , Configuration config ) {
2512
+ private predicate revConsCand ( TypedContent tc , Ap ap , Configuration config ) {
2499
2513
storeStepCand ( _, ap , tc , _, _, config )
2500
2514
}
2501
2515
2516
+ private predicate validAp ( Ap ap , Configuration config ) {
2517
+ revFlow ( _, _, _, _, ap , config ) and ap instanceof ApNil
2518
+ or
2519
+ exists ( TypedContent head , Ap tail |
2520
+ consCand ( head , tail , config ) and
2521
+ ap = apCons ( head , tail )
2522
+ )
2523
+ }
2524
+
2525
+ predicate consCand ( TypedContent tc , Ap ap , Configuration config ) {
2526
+ revConsCand ( tc , ap , config ) and
2527
+ validAp ( ap , config )
2528
+ }
2529
+
2502
2530
pragma [ noinline]
2503
2531
private predicate parameterFlow (
2504
2532
ParamNodeEx p , Ap ap , Ap ap0 , DataFlowCallable c , Configuration config
@@ -3322,10 +3350,24 @@ private module Stage4 {
3322
3350
storeStepFwd ( _, ap , tc , _, _, config )
3323
3351
}
3324
3352
3325
- predicate consCand ( TypedContent tc , Ap ap , Configuration config ) {
3353
+ private predicate revConsCand ( TypedContent tc , Ap ap , Configuration config ) {
3326
3354
storeStepCand ( _, ap , tc , _, _, config )
3327
3355
}
3328
3356
3357
+ private predicate validAp ( Ap ap , Configuration config ) {
3358
+ revFlow ( _, _, _, _, ap , config ) and ap instanceof ApNil
3359
+ or
3360
+ exists ( TypedContent head , Ap tail |
3361
+ consCand ( head , tail , config ) and
3362
+ ap = apCons ( head , tail )
3363
+ )
3364
+ }
3365
+
3366
+ predicate consCand ( TypedContent tc , Ap ap , Configuration config ) {
3367
+ revConsCand ( tc , ap , config ) and
3368
+ validAp ( ap , config )
3369
+ }
3370
+
3329
3371
pragma [ noinline]
3330
3372
private predicate parameterFlow (
3331
3373
ParamNodeEx p , Ap ap , Ap ap0 , DataFlowCallable c , Configuration config
0 commit comments