Skip to content

Commit 2d24387

Browse files
authored
Merge pull request github#6149 from edoardopirovano/fix-java-regression
Performance: Fix bad join order in Java dataflow library
2 parents 1cddcdf + 0909c9f commit 2d24387

File tree

24 files changed

+144
-72
lines changed

24 files changed

+144
-72
lines changed

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,8 @@ private module Stage2 {
13941394
parameterFlow(p, ap, ap0, c, config) and
13951395
c = ret.getEnclosingCallable() and
13961396
revFlow(ret, true, apSome(_), ap0, config) and
1397-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1397+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1398+
pragma[only_bind_into](config)) and
13981399
kind = ret.getKind() and
13991400
p.getPosition() = pos and
14001401
// we don't expect a parameter to return stored in itself
@@ -2087,7 +2088,8 @@ private module Stage3 {
20872088
parameterFlow(p, ap, ap0, c, config) and
20882089
c = ret.getEnclosingCallable() and
20892090
revFlow(ret, true, apSome(_), ap0, config) and
2090-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2091+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2092+
pragma[only_bind_into](config)) and
20912093
kind = ret.getKind() and
20922094
p.getPosition() = pos and
20932095
// we don't expect a parameter to return stored in itself
@@ -2849,7 +2851,8 @@ private module Stage4 {
28492851
parameterFlow(p, ap, ap0, c, config) and
28502852
c = ret.getEnclosingCallable() and
28512853
revFlow(ret, true, apSome(_), ap0, config) and
2852-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2854+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2855+
pragma[only_bind_into](config)) and
28532856
kind = ret.getKind() and
28542857
p.getPosition() = pos and
28552858
// we don't expect a parameter to return stored in itself

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,8 @@ private module Stage2 {
13941394
parameterFlow(p, ap, ap0, c, config) and
13951395
c = ret.getEnclosingCallable() and
13961396
revFlow(ret, true, apSome(_), ap0, config) and
1397-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1397+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1398+
pragma[only_bind_into](config)) and
13981399
kind = ret.getKind() and
13991400
p.getPosition() = pos and
14001401
// we don't expect a parameter to return stored in itself
@@ -2087,7 +2088,8 @@ private module Stage3 {
20872088
parameterFlow(p, ap, ap0, c, config) and
20882089
c = ret.getEnclosingCallable() and
20892090
revFlow(ret, true, apSome(_), ap0, config) and
2090-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2091+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2092+
pragma[only_bind_into](config)) and
20912093
kind = ret.getKind() and
20922094
p.getPosition() = pos and
20932095
// we don't expect a parameter to return stored in itself
@@ -2849,7 +2851,8 @@ private module Stage4 {
28492851
parameterFlow(p, ap, ap0, c, config) and
28502852
c = ret.getEnclosingCallable() and
28512853
revFlow(ret, true, apSome(_), ap0, config) and
2852-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2854+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2855+
pragma[only_bind_into](config)) and
28532856
kind = ret.getKind() and
28542857
p.getPosition() = pos and
28552858
// we don't expect a parameter to return stored in itself

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,8 @@ private module Stage2 {
13941394
parameterFlow(p, ap, ap0, c, config) and
13951395
c = ret.getEnclosingCallable() and
13961396
revFlow(ret, true, apSome(_), ap0, config) and
1397-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1397+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1398+
pragma[only_bind_into](config)) and
13981399
kind = ret.getKind() and
13991400
p.getPosition() = pos and
14001401
// we don't expect a parameter to return stored in itself
@@ -2087,7 +2088,8 @@ private module Stage3 {
20872088
parameterFlow(p, ap, ap0, c, config) and
20882089
c = ret.getEnclosingCallable() and
20892090
revFlow(ret, true, apSome(_), ap0, config) and
2090-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2091+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2092+
pragma[only_bind_into](config)) and
20912093
kind = ret.getKind() and
20922094
p.getPosition() = pos and
20932095
// we don't expect a parameter to return stored in itself
@@ -2849,7 +2851,8 @@ private module Stage4 {
28492851
parameterFlow(p, ap, ap0, c, config) and
28502852
c = ret.getEnclosingCallable() and
28512853
revFlow(ret, true, apSome(_), ap0, config) and
2852-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2854+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2855+
pragma[only_bind_into](config)) and
28532856
kind = ret.getKind() and
28542857
p.getPosition() = pos and
28552858
// we don't expect a parameter to return stored in itself

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,8 @@ private module Stage2 {
13941394
parameterFlow(p, ap, ap0, c, config) and
13951395
c = ret.getEnclosingCallable() and
13961396
revFlow(ret, true, apSome(_), ap0, config) and
1397-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1397+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1398+
pragma[only_bind_into](config)) and
13981399
kind = ret.getKind() and
13991400
p.getPosition() = pos and
14001401
// we don't expect a parameter to return stored in itself
@@ -2087,7 +2088,8 @@ private module Stage3 {
20872088
parameterFlow(p, ap, ap0, c, config) and
20882089
c = ret.getEnclosingCallable() and
20892090
revFlow(ret, true, apSome(_), ap0, config) and
2090-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2091+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2092+
pragma[only_bind_into](config)) and
20912093
kind = ret.getKind() and
20922094
p.getPosition() = pos and
20932095
// we don't expect a parameter to return stored in itself
@@ -2849,7 +2851,8 @@ private module Stage4 {
28492851
parameterFlow(p, ap, ap0, c, config) and
28502852
c = ret.getEnclosingCallable() and
28512853
revFlow(ret, true, apSome(_), ap0, config) and
2852-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2854+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2855+
pragma[only_bind_into](config)) and
28532856
kind = ret.getKind() and
28542857
p.getPosition() = pos and
28552858
// we don't expect a parameter to return stored in itself

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,8 @@ private module Stage2 {
13941394
parameterFlow(p, ap, ap0, c, config) and
13951395
c = ret.getEnclosingCallable() and
13961396
revFlow(ret, true, apSome(_), ap0, config) and
1397-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1397+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1398+
pragma[only_bind_into](config)) and
13981399
kind = ret.getKind() and
13991400
p.getPosition() = pos and
14001401
// we don't expect a parameter to return stored in itself
@@ -2087,7 +2088,8 @@ private module Stage3 {
20872088
parameterFlow(p, ap, ap0, c, config) and
20882089
c = ret.getEnclosingCallable() and
20892090
revFlow(ret, true, apSome(_), ap0, config) and
2090-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2091+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2092+
pragma[only_bind_into](config)) and
20912093
kind = ret.getKind() and
20922094
p.getPosition() = pos and
20932095
// we don't expect a parameter to return stored in itself
@@ -2849,7 +2851,8 @@ private module Stage4 {
28492851
parameterFlow(p, ap, ap0, c, config) and
28502852
c = ret.getEnclosingCallable() and
28512853
revFlow(ret, true, apSome(_), ap0, config) and
2852-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2854+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2855+
pragma[only_bind_into](config)) and
28532856
kind = ret.getKind() and
28542857
p.getPosition() = pos and
28552858
// we don't expect a parameter to return stored in itself

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,8 @@ private module Stage2 {
13941394
parameterFlow(p, ap, ap0, c, config) and
13951395
c = ret.getEnclosingCallable() and
13961396
revFlow(ret, true, apSome(_), ap0, config) and
1397-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1397+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1398+
pragma[only_bind_into](config)) and
13981399
kind = ret.getKind() and
13991400
p.getPosition() = pos and
14001401
// we don't expect a parameter to return stored in itself
@@ -2087,7 +2088,8 @@ private module Stage3 {
20872088
parameterFlow(p, ap, ap0, c, config) and
20882089
c = ret.getEnclosingCallable() and
20892090
revFlow(ret, true, apSome(_), ap0, config) and
2090-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2091+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2092+
pragma[only_bind_into](config)) and
20912093
kind = ret.getKind() and
20922094
p.getPosition() = pos and
20932095
// we don't expect a parameter to return stored in itself
@@ -2849,7 +2851,8 @@ private module Stage4 {
28492851
parameterFlow(p, ap, ap0, c, config) and
28502852
c = ret.getEnclosingCallable() and
28512853
revFlow(ret, true, apSome(_), ap0, config) and
2852-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2854+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2855+
pragma[only_bind_into](config)) and
28532856
kind = ret.getKind() and
28542857
p.getPosition() = pos and
28552858
// we don't expect a parameter to return stored in itself

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,8 @@ private module Stage2 {
13941394
parameterFlow(p, ap, ap0, c, config) and
13951395
c = ret.getEnclosingCallable() and
13961396
revFlow(ret, true, apSome(_), ap0, config) and
1397-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1397+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1398+
pragma[only_bind_into](config)) and
13981399
kind = ret.getKind() and
13991400
p.getPosition() = pos and
14001401
// we don't expect a parameter to return stored in itself
@@ -2087,7 +2088,8 @@ private module Stage3 {
20872088
parameterFlow(p, ap, ap0, c, config) and
20882089
c = ret.getEnclosingCallable() and
20892090
revFlow(ret, true, apSome(_), ap0, config) and
2090-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2091+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2092+
pragma[only_bind_into](config)) and
20912093
kind = ret.getKind() and
20922094
p.getPosition() = pos and
20932095
// we don't expect a parameter to return stored in itself
@@ -2849,7 +2851,8 @@ private module Stage4 {
28492851
parameterFlow(p, ap, ap0, c, config) and
28502852
c = ret.getEnclosingCallable() and
28512853
revFlow(ret, true, apSome(_), ap0, config) and
2852-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2854+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2855+
pragma[only_bind_into](config)) and
28532856
kind = ret.getKind() and
28542857
p.getPosition() = pos and
28552858
// we don't expect a parameter to return stored in itself

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,8 @@ private module Stage2 {
13941394
parameterFlow(p, ap, ap0, c, config) and
13951395
c = ret.getEnclosingCallable() and
13961396
revFlow(ret, true, apSome(_), ap0, config) and
1397-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1397+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1398+
pragma[only_bind_into](config)) and
13981399
kind = ret.getKind() and
13991400
p.getPosition() = pos and
14001401
// we don't expect a parameter to return stored in itself
@@ -2087,7 +2088,8 @@ private module Stage3 {
20872088
parameterFlow(p, ap, ap0, c, config) and
20882089
c = ret.getEnclosingCallable() and
20892090
revFlow(ret, true, apSome(_), ap0, config) and
2090-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2091+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2092+
pragma[only_bind_into](config)) and
20912093
kind = ret.getKind() and
20922094
p.getPosition() = pos and
20932095
// we don't expect a parameter to return stored in itself
@@ -2849,7 +2851,8 @@ private module Stage4 {
28492851
parameterFlow(p, ap, ap0, c, config) and
28502852
c = ret.getEnclosingCallable() and
28512853
revFlow(ret, true, apSome(_), ap0, config) and
2852-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2854+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2855+
pragma[only_bind_into](config)) and
28532856
kind = ret.getKind() and
28542857
p.getPosition() = pos and
28552858
// we don't expect a parameter to return stored in itself

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,8 @@ private module Stage2 {
13941394
parameterFlow(p, ap, ap0, c, config) and
13951395
c = ret.getEnclosingCallable() and
13961396
revFlow(ret, true, apSome(_), ap0, config) and
1397-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1397+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1398+
pragma[only_bind_into](config)) and
13981399
kind = ret.getKind() and
13991400
p.getPosition() = pos and
14001401
// we don't expect a parameter to return stored in itself
@@ -2087,7 +2088,8 @@ private module Stage3 {
20872088
parameterFlow(p, ap, ap0, c, config) and
20882089
c = ret.getEnclosingCallable() and
20892090
revFlow(ret, true, apSome(_), ap0, config) and
2090-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2091+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2092+
pragma[only_bind_into](config)) and
20912093
kind = ret.getKind() and
20922094
p.getPosition() = pos and
20932095
// we don't expect a parameter to return stored in itself
@@ -2849,7 +2851,8 @@ private module Stage4 {
28492851
parameterFlow(p, ap, ap0, c, config) and
28502852
c = ret.getEnclosingCallable() and
28512853
revFlow(ret, true, apSome(_), ap0, config) and
2852-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2854+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2855+
pragma[only_bind_into](config)) and
28532856
kind = ret.getKind() and
28542857
p.getPosition() = pos and
28552858
// we don't expect a parameter to return stored in itself

csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,8 @@ private module Stage2 {
13941394
parameterFlow(p, ap, ap0, c, config) and
13951395
c = ret.getEnclosingCallable() and
13961396
revFlow(ret, true, apSome(_), ap0, config) and
1397-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1397+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1398+
pragma[only_bind_into](config)) and
13981399
kind = ret.getKind() and
13991400
p.getPosition() = pos and
14001401
// we don't expect a parameter to return stored in itself
@@ -2087,7 +2088,8 @@ private module Stage3 {
20872088
parameterFlow(p, ap, ap0, c, config) and
20882089
c = ret.getEnclosingCallable() and
20892090
revFlow(ret, true, apSome(_), ap0, config) and
2090-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2091+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2092+
pragma[only_bind_into](config)) and
20912093
kind = ret.getKind() and
20922094
p.getPosition() = pos and
20932095
// we don't expect a parameter to return stored in itself
@@ -2849,7 +2851,8 @@ private module Stage4 {
28492851
parameterFlow(p, ap, ap0, c, config) and
28502852
c = ret.getEnclosingCallable() and
28512853
revFlow(ret, true, apSome(_), ap0, config) and
2852-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2854+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2855+
pragma[only_bind_into](config)) and
28532856
kind = ret.getKind() and
28542857
p.getPosition() = pos and
28552858
// we don't expect a parameter to return stored in itself

0 commit comments

Comments
 (0)