Skip to content

Commit a7ec0fa

Browse files
committed
Dataflow: Remove more disjunction-induced tuple duplication.
1 parent 4efdcc2 commit a7ec0fa

File tree

1 file changed

+18
-27
lines changed

1 file changed

+18
-27
lines changed

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

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,9 +1347,8 @@ private module Stage2 {
13471347
) {
13481348
exists(NodeEx out, boolean allowsFieldFlow |
13491349
revFlow(out, toReturn, returnAp, ap, config) and
1350-
flowOutOfCall(call, ret, out, allowsFieldFlow, config)
1351-
|
1352-
ap instanceof ApNil or allowsFieldFlow = true
1350+
flowOutOfCall(call, ret, out, allowsFieldFlow, config) and
1351+
if allowsFieldFlow = false then ap instanceof ApNil else any()
13531352
)
13541353
}
13551354

@@ -1359,9 +1358,8 @@ private module Stage2 {
13591358
) {
13601359
exists(ParamNodeEx p, boolean allowsFieldFlow |
13611360
revFlow(p, false, returnAp, ap, config) and
1362-
flowIntoCall(_, arg, p, allowsFieldFlow, config)
1363-
|
1364-
ap instanceof ApNil or allowsFieldFlow = true
1361+
flowIntoCall(_, arg, p, allowsFieldFlow, config) and
1362+
if allowsFieldFlow = false then ap instanceof ApNil else any()
13651363
)
13661364
}
13671365

@@ -1371,9 +1369,8 @@ private module Stage2 {
13711369
) {
13721370
exists(ParamNodeEx p, boolean allowsFieldFlow |
13731371
revFlow(p, true, apSome(returnAp), ap, config) and
1374-
flowThroughIntoCall(call, arg, p, allowsFieldFlow, config)
1375-
|
1376-
ap instanceof ApNil or allowsFieldFlow = true
1372+
flowThroughIntoCall(call, arg, p, allowsFieldFlow, config) and
1373+
if allowsFieldFlow = false then ap instanceof ApNil else any()
13771374
)
13781375
}
13791376

@@ -2045,9 +2042,8 @@ private module Stage3 {
20452042
) {
20462043
exists(NodeEx out, boolean allowsFieldFlow |
20472044
revFlow(out, toReturn, returnAp, ap, config) and
2048-
flowOutOfCall(call, ret, out, allowsFieldFlow, config)
2049-
|
2050-
ap instanceof ApNil or allowsFieldFlow = true
2045+
flowOutOfCall(call, ret, out, allowsFieldFlow, config) and
2046+
if allowsFieldFlow = false then ap instanceof ApNil else any()
20512047
)
20522048
}
20532049

@@ -2057,9 +2053,8 @@ private module Stage3 {
20572053
) {
20582054
exists(ParamNodeEx p, boolean allowsFieldFlow |
20592055
revFlow(p, false, returnAp, ap, config) and
2060-
flowIntoCall(_, arg, p, allowsFieldFlow, config)
2061-
|
2062-
ap instanceof ApNil or allowsFieldFlow = true
2056+
flowIntoCall(_, arg, p, allowsFieldFlow, config) and
2057+
if allowsFieldFlow = false then ap instanceof ApNil else any()
20632058
)
20642059
}
20652060

@@ -2069,9 +2064,8 @@ private module Stage3 {
20692064
) {
20702065
exists(ParamNodeEx p, boolean allowsFieldFlow |
20712066
revFlow(p, true, apSome(returnAp), ap, config) and
2072-
flowThroughIntoCall(call, arg, p, allowsFieldFlow, config)
2073-
|
2074-
ap instanceof ApNil or allowsFieldFlow = true
2067+
flowThroughIntoCall(call, arg, p, allowsFieldFlow, config) and
2068+
if allowsFieldFlow = false then ap instanceof ApNil else any()
20752069
)
20762070
}
20772071

@@ -2814,9 +2808,8 @@ private module Stage4 {
28142808
) {
28152809
exists(NodeEx out, boolean allowsFieldFlow |
28162810
revFlow(out, toReturn, returnAp, ap, config) and
2817-
flowOutOfCall(call, ret, out, allowsFieldFlow, config)
2818-
|
2819-
ap instanceof ApNil or allowsFieldFlow = true
2811+
flowOutOfCall(call, ret, out, allowsFieldFlow, config) and
2812+
if allowsFieldFlow = false then ap instanceof ApNil else any()
28202813
)
28212814
}
28222815

@@ -2826,9 +2819,8 @@ private module Stage4 {
28262819
) {
28272820
exists(ParamNodeEx p, boolean allowsFieldFlow |
28282821
revFlow(p, false, returnAp, ap, config) and
2829-
flowIntoCall(_, arg, p, allowsFieldFlow, config)
2830-
|
2831-
ap instanceof ApNil or allowsFieldFlow = true
2822+
flowIntoCall(_, arg, p, allowsFieldFlow, config) and
2823+
if allowsFieldFlow = false then ap instanceof ApNil else any()
28322824
)
28332825
}
28342826

@@ -2838,9 +2830,8 @@ private module Stage4 {
28382830
) {
28392831
exists(ParamNodeEx p, boolean allowsFieldFlow |
28402832
revFlow(p, true, apSome(returnAp), ap, config) and
2841-
flowThroughIntoCall(call, arg, p, allowsFieldFlow, config)
2842-
|
2843-
ap instanceof ApNil or allowsFieldFlow = true
2833+
flowThroughIntoCall(call, arg, p, allowsFieldFlow, config) and
2834+
if allowsFieldFlow = false then ap instanceof ApNil else any()
28442835
)
28452836
}
28462837

0 commit comments

Comments
 (0)