Skip to content

Commit 0909c9f

Browse files
Performance: Fix bad join order in dataflow library
1 parent 653afc8 commit 0909c9f

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
@@ -1247,7 +1247,8 @@ private module Stage2 {
12471247
parameterFlow(p, ap, ap0, c, config) and
12481248
c = getNodeEnclosingCallable(ret) and
12491249
revFlow(ret, true, apSome(_), ap0, config) and
1250-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1250+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1251+
pragma[only_bind_into](config)) and
12511252
kind = ret.getKind() and
12521253
p.isParameterOf(_, pos) and
12531254
// we don't expect a parameter to return stored in itself
@@ -1928,7 +1929,8 @@ private module Stage3 {
19281929
parameterFlow(p, ap, ap0, c, config) and
19291930
c = getNodeEnclosingCallable(ret) and
19301931
revFlow(ret, true, apSome(_), ap0, config) and
1931-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1932+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1933+
pragma[only_bind_into](config)) and
19321934
kind = ret.getKind() and
19331935
p.isParameterOf(_, pos) and
19341936
// we don't expect a parameter to return stored in itself
@@ -2683,7 +2685,8 @@ private module Stage4 {
26832685
parameterFlow(p, ap, ap0, c, config) and
26842686
c = getNodeEnclosingCallable(ret) and
26852687
revFlow(ret, true, apSome(_), ap0, config) and
2686-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2688+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2689+
pragma[only_bind_into](config)) and
26872690
kind = ret.getKind() and
26882691
p.isParameterOf(_, pos) and
26892692
// 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
@@ -1247,7 +1247,8 @@ private module Stage2 {
12471247
parameterFlow(p, ap, ap0, c, config) and
12481248
c = getNodeEnclosingCallable(ret) and
12491249
revFlow(ret, true, apSome(_), ap0, config) and
1250-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1250+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1251+
pragma[only_bind_into](config)) and
12511252
kind = ret.getKind() and
12521253
p.isParameterOf(_, pos) and
12531254
// we don't expect a parameter to return stored in itself
@@ -1928,7 +1929,8 @@ private module Stage3 {
19281929
parameterFlow(p, ap, ap0, c, config) and
19291930
c = getNodeEnclosingCallable(ret) and
19301931
revFlow(ret, true, apSome(_), ap0, config) and
1931-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1932+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1933+
pragma[only_bind_into](config)) and
19321934
kind = ret.getKind() and
19331935
p.isParameterOf(_, pos) and
19341936
// we don't expect a parameter to return stored in itself
@@ -2683,7 +2685,8 @@ private module Stage4 {
26832685
parameterFlow(p, ap, ap0, c, config) and
26842686
c = getNodeEnclosingCallable(ret) and
26852687
revFlow(ret, true, apSome(_), ap0, config) and
2686-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2688+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2689+
pragma[only_bind_into](config)) and
26872690
kind = ret.getKind() and
26882691
p.isParameterOf(_, pos) and
26892692
// 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
@@ -1247,7 +1247,8 @@ private module Stage2 {
12471247
parameterFlow(p, ap, ap0, c, config) and
12481248
c = getNodeEnclosingCallable(ret) and
12491249
revFlow(ret, true, apSome(_), ap0, config) and
1250-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1250+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1251+
pragma[only_bind_into](config)) and
12511252
kind = ret.getKind() and
12521253
p.isParameterOf(_, pos) and
12531254
// we don't expect a parameter to return stored in itself
@@ -1928,7 +1929,8 @@ private module Stage3 {
19281929
parameterFlow(p, ap, ap0, c, config) and
19291930
c = getNodeEnclosingCallable(ret) and
19301931
revFlow(ret, true, apSome(_), ap0, config) and
1931-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1932+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1933+
pragma[only_bind_into](config)) and
19321934
kind = ret.getKind() and
19331935
p.isParameterOf(_, pos) and
19341936
// we don't expect a parameter to return stored in itself
@@ -2683,7 +2685,8 @@ private module Stage4 {
26832685
parameterFlow(p, ap, ap0, c, config) and
26842686
c = getNodeEnclosingCallable(ret) and
26852687
revFlow(ret, true, apSome(_), ap0, config) and
2686-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2688+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2689+
pragma[only_bind_into](config)) and
26872690
kind = ret.getKind() and
26882691
p.isParameterOf(_, pos) and
26892692
// 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
@@ -1247,7 +1247,8 @@ private module Stage2 {
12471247
parameterFlow(p, ap, ap0, c, config) and
12481248
c = getNodeEnclosingCallable(ret) and
12491249
revFlow(ret, true, apSome(_), ap0, config) and
1250-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1250+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1251+
pragma[only_bind_into](config)) and
12511252
kind = ret.getKind() and
12521253
p.isParameterOf(_, pos) and
12531254
// we don't expect a parameter to return stored in itself
@@ -1928,7 +1929,8 @@ private module Stage3 {
19281929
parameterFlow(p, ap, ap0, c, config) and
19291930
c = getNodeEnclosingCallable(ret) and
19301931
revFlow(ret, true, apSome(_), ap0, config) and
1931-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1932+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1933+
pragma[only_bind_into](config)) and
19321934
kind = ret.getKind() and
19331935
p.isParameterOf(_, pos) and
19341936
// we don't expect a parameter to return stored in itself
@@ -2683,7 +2685,8 @@ private module Stage4 {
26832685
parameterFlow(p, ap, ap0, c, config) and
26842686
c = getNodeEnclosingCallable(ret) and
26852687
revFlow(ret, true, apSome(_), ap0, config) and
2686-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2688+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2689+
pragma[only_bind_into](config)) and
26872690
kind = ret.getKind() and
26882691
p.isParameterOf(_, pos) and
26892692
// 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
@@ -1247,7 +1247,8 @@ private module Stage2 {
12471247
parameterFlow(p, ap, ap0, c, config) and
12481248
c = getNodeEnclosingCallable(ret) and
12491249
revFlow(ret, true, apSome(_), ap0, config) and
1250-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1250+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1251+
pragma[only_bind_into](config)) and
12511252
kind = ret.getKind() and
12521253
p.isParameterOf(_, pos) and
12531254
// we don't expect a parameter to return stored in itself
@@ -1928,7 +1929,8 @@ private module Stage3 {
19281929
parameterFlow(p, ap, ap0, c, config) and
19291930
c = getNodeEnclosingCallable(ret) and
19301931
revFlow(ret, true, apSome(_), ap0, config) and
1931-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1932+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1933+
pragma[only_bind_into](config)) and
19321934
kind = ret.getKind() and
19331935
p.isParameterOf(_, pos) and
19341936
// we don't expect a parameter to return stored in itself
@@ -2683,7 +2685,8 @@ private module Stage4 {
26832685
parameterFlow(p, ap, ap0, c, config) and
26842686
c = getNodeEnclosingCallable(ret) and
26852687
revFlow(ret, true, apSome(_), ap0, config) and
2686-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2688+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2689+
pragma[only_bind_into](config)) and
26872690
kind = ret.getKind() and
26882691
p.isParameterOf(_, pos) and
26892692
// 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
@@ -1247,7 +1247,8 @@ private module Stage2 {
12471247
parameterFlow(p, ap, ap0, c, config) and
12481248
c = getNodeEnclosingCallable(ret) and
12491249
revFlow(ret, true, apSome(_), ap0, config) and
1250-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1250+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1251+
pragma[only_bind_into](config)) and
12511252
kind = ret.getKind() and
12521253
p.isParameterOf(_, pos) and
12531254
// we don't expect a parameter to return stored in itself
@@ -1928,7 +1929,8 @@ private module Stage3 {
19281929
parameterFlow(p, ap, ap0, c, config) and
19291930
c = getNodeEnclosingCallable(ret) and
19301931
revFlow(ret, true, apSome(_), ap0, config) and
1931-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1932+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1933+
pragma[only_bind_into](config)) and
19321934
kind = ret.getKind() and
19331935
p.isParameterOf(_, pos) and
19341936
// we don't expect a parameter to return stored in itself
@@ -2683,7 +2685,8 @@ private module Stage4 {
26832685
parameterFlow(p, ap, ap0, c, config) and
26842686
c = getNodeEnclosingCallable(ret) and
26852687
revFlow(ret, true, apSome(_), ap0, config) and
2686-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2688+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2689+
pragma[only_bind_into](config)) and
26872690
kind = ret.getKind() and
26882691
p.isParameterOf(_, pos) and
26892692
// 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
@@ -1247,7 +1247,8 @@ private module Stage2 {
12471247
parameterFlow(p, ap, ap0, c, config) and
12481248
c = getNodeEnclosingCallable(ret) and
12491249
revFlow(ret, true, apSome(_), ap0, config) and
1250-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1250+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1251+
pragma[only_bind_into](config)) and
12511252
kind = ret.getKind() and
12521253
p.isParameterOf(_, pos) and
12531254
// we don't expect a parameter to return stored in itself
@@ -1928,7 +1929,8 @@ private module Stage3 {
19281929
parameterFlow(p, ap, ap0, c, config) and
19291930
c = getNodeEnclosingCallable(ret) and
19301931
revFlow(ret, true, apSome(_), ap0, config) and
1931-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1932+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1933+
pragma[only_bind_into](config)) and
19321934
kind = ret.getKind() and
19331935
p.isParameterOf(_, pos) and
19341936
// we don't expect a parameter to return stored in itself
@@ -2683,7 +2685,8 @@ private module Stage4 {
26832685
parameterFlow(p, ap, ap0, c, config) and
26842686
c = getNodeEnclosingCallable(ret) and
26852687
revFlow(ret, true, apSome(_), ap0, config) and
2686-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2688+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2689+
pragma[only_bind_into](config)) and
26872690
kind = ret.getKind() and
26882691
p.isParameterOf(_, pos) and
26892692
// 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
@@ -1247,7 +1247,8 @@ private module Stage2 {
12471247
parameterFlow(p, ap, ap0, c, config) and
12481248
c = getNodeEnclosingCallable(ret) and
12491249
revFlow(ret, true, apSome(_), ap0, config) and
1250-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1250+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1251+
pragma[only_bind_into](config)) and
12511252
kind = ret.getKind() and
12521253
p.isParameterOf(_, pos) and
12531254
// we don't expect a parameter to return stored in itself
@@ -1928,7 +1929,8 @@ private module Stage3 {
19281929
parameterFlow(p, ap, ap0, c, config) and
19291930
c = getNodeEnclosingCallable(ret) and
19301931
revFlow(ret, true, apSome(_), ap0, config) and
1931-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1932+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1933+
pragma[only_bind_into](config)) and
19321934
kind = ret.getKind() and
19331935
p.isParameterOf(_, pos) and
19341936
// we don't expect a parameter to return stored in itself
@@ -2683,7 +2685,8 @@ private module Stage4 {
26832685
parameterFlow(p, ap, ap0, c, config) and
26842686
c = getNodeEnclosingCallable(ret) and
26852687
revFlow(ret, true, apSome(_), ap0, config) and
2686-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2688+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2689+
pragma[only_bind_into](config)) and
26872690
kind = ret.getKind() and
26882691
p.isParameterOf(_, pos) and
26892692
// 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
@@ -1247,7 +1247,8 @@ private module Stage2 {
12471247
parameterFlow(p, ap, ap0, c, config) and
12481248
c = getNodeEnclosingCallable(ret) and
12491249
revFlow(ret, true, apSome(_), ap0, config) and
1250-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1250+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1251+
pragma[only_bind_into](config)) and
12511252
kind = ret.getKind() and
12521253
p.isParameterOf(_, pos) and
12531254
// we don't expect a parameter to return stored in itself
@@ -1928,7 +1929,8 @@ private module Stage3 {
19281929
parameterFlow(p, ap, ap0, c, config) and
19291930
c = getNodeEnclosingCallable(ret) and
19301931
revFlow(ret, true, apSome(_), ap0, config) and
1931-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1932+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1933+
pragma[only_bind_into](config)) and
19321934
kind = ret.getKind() and
19331935
p.isParameterOf(_, pos) and
19341936
// we don't expect a parameter to return stored in itself
@@ -2683,7 +2685,8 @@ private module Stage4 {
26832685
parameterFlow(p, ap, ap0, c, config) and
26842686
c = getNodeEnclosingCallable(ret) and
26852687
revFlow(ret, true, apSome(_), ap0, config) and
2686-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2688+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2689+
pragma[only_bind_into](config)) and
26872690
kind = ret.getKind() and
26882691
p.isParameterOf(_, pos) and
26892692
// 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
@@ -1247,7 +1247,8 @@ private module Stage2 {
12471247
parameterFlow(p, ap, ap0, c, config) and
12481248
c = getNodeEnclosingCallable(ret) and
12491249
revFlow(ret, true, apSome(_), ap0, config) and
1250-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1250+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1251+
pragma[only_bind_into](config)) and
12511252
kind = ret.getKind() and
12521253
p.isParameterOf(_, pos) and
12531254
// we don't expect a parameter to return stored in itself
@@ -1928,7 +1929,8 @@ private module Stage3 {
19281929
parameterFlow(p, ap, ap0, c, config) and
19291930
c = getNodeEnclosingCallable(ret) and
19301931
revFlow(ret, true, apSome(_), ap0, config) and
1931-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
1932+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
1933+
pragma[only_bind_into](config)) and
19321934
kind = ret.getKind() and
19331935
p.isParameterOf(_, pos) and
19341936
// we don't expect a parameter to return stored in itself
@@ -2683,7 +2685,8 @@ private module Stage4 {
26832685
parameterFlow(p, ap, ap0, c, config) and
26842686
c = getNodeEnclosingCallable(ret) and
26852687
revFlow(ret, true, apSome(_), ap0, config) and
2686-
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
2688+
fwdFlow(ret, any(CcCall ccc), apSome(ap), pragma[only_bind_into](ap0),
2689+
pragma[only_bind_into](config)) and
26872690
kind = ret.getKind() and
26882691
p.isParameterOf(_, pos) and
26892692
// we don't expect a parameter to return stored in itself

0 commit comments

Comments
 (0)