Skip to content

Commit f5f67dd

Browse files
committed
Dataflow: Pull ccc.matchesCall(call) from the recursive loop.
1 parent e711ba9 commit f5f67dd

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,12 +1019,14 @@ private module Stage2 {
10191019

10201020
pragma[nomagic]
10211021
private predicate flowThroughOutOfCall(
1022-
DataFlowCall call, RetNodeEx ret, NodeEx out, boolean allowsFieldFlow, Configuration config
1022+
DataFlowCall call, CcCall ccc, RetNodeEx ret, NodeEx out, boolean allowsFieldFlow,
1023+
Configuration config
10231024
) {
10241025
flowOutOfCall(call, ret, out, allowsFieldFlow, pragma[only_bind_into](config)) and
10251026
PrevStage::callMayFlowThroughRev(call, pragma[only_bind_into](config)) and
10261027
PrevStage::parameterMayFlowThrough(_, ret.getEnclosingCallable(), _,
1027-
pragma[only_bind_into](config))
1028+
pragma[only_bind_into](config)) and
1029+
ccc.matchesCall(call)
10281030
}
10291031

10301032
/**
@@ -1171,8 +1173,7 @@ private module Stage2 {
11711173
) {
11721174
exists(RetNodeEx ret, boolean allowsFieldFlow, CcCall ccc |
11731175
fwdFlow(ret, ccc, apSome(argAp), ap, config) and
1174-
flowThroughOutOfCall(call, ret, out, allowsFieldFlow, config) and
1175-
ccc.matchesCall(call)
1176+
flowThroughOutOfCall(call, ccc, ret, out, allowsFieldFlow, config)
11761177
|
11771178
ap instanceof ApNil or allowsFieldFlow = true
11781179
)
@@ -1712,12 +1713,14 @@ private module Stage3 {
17121713

17131714
pragma[nomagic]
17141715
private predicate flowThroughOutOfCall(
1715-
DataFlowCall call, RetNodeEx ret, NodeEx out, boolean allowsFieldFlow, Configuration config
1716+
DataFlowCall call, CcCall ccc, RetNodeEx ret, NodeEx out, boolean allowsFieldFlow,
1717+
Configuration config
17161718
) {
17171719
flowOutOfCall(call, ret, out, allowsFieldFlow, pragma[only_bind_into](config)) and
17181720
PrevStage::callMayFlowThroughRev(call, pragma[only_bind_into](config)) and
17191721
PrevStage::parameterMayFlowThrough(_, ret.getEnclosingCallable(), _,
1720-
pragma[only_bind_into](config))
1722+
pragma[only_bind_into](config)) and
1723+
ccc.matchesCall(call)
17211724
}
17221725

17231726
/**
@@ -1871,8 +1874,7 @@ private module Stage3 {
18711874
) {
18721875
exists(RetNodeEx ret, boolean allowsFieldFlow, CcCall ccc |
18731876
fwdFlow(ret, ccc, apSome(argAp), ap, config) and
1874-
flowThroughOutOfCall(call, ret, out, allowsFieldFlow, config) and
1875-
ccc.matchesCall(call)
1877+
flowThroughOutOfCall(call, ccc, ret, out, allowsFieldFlow, config)
18761878
|
18771879
ap instanceof ApNil or allowsFieldFlow = true
18781880
)
@@ -2483,12 +2485,14 @@ private module Stage4 {
24832485

24842486
pragma[nomagic]
24852487
private predicate flowThroughOutOfCall(
2486-
DataFlowCall call, RetNodeEx ret, NodeEx out, boolean allowsFieldFlow, Configuration config
2488+
DataFlowCall call, CcCall ccc, RetNodeEx ret, NodeEx out, boolean allowsFieldFlow,
2489+
Configuration config
24872490
) {
24882491
flowOutOfCall(call, ret, out, allowsFieldFlow, pragma[only_bind_into](config)) and
24892492
PrevStage::callMayFlowThroughRev(call, pragma[only_bind_into](config)) and
24902493
PrevStage::parameterMayFlowThrough(_, ret.getEnclosingCallable(), _,
2491-
pragma[only_bind_into](config))
2494+
pragma[only_bind_into](config)) and
2495+
ccc.matchesCall(call)
24922496
}
24932497

24942498
/**
@@ -2642,8 +2646,7 @@ private module Stage4 {
26422646
) {
26432647
exists(RetNodeEx ret, boolean allowsFieldFlow, CcCall ccc |
26442648
fwdFlow(ret, ccc, apSome(argAp), ap, config) and
2645-
flowThroughOutOfCall(call, ret, out, allowsFieldFlow, config) and
2646-
ccc.matchesCall(call)
2649+
flowThroughOutOfCall(call, ccc, ret, out, allowsFieldFlow, config)
26472650
|
26482651
ap instanceof ApNil or allowsFieldFlow = true
26492652
)

0 commit comments

Comments
 (0)