Skip to content

Commit 8522edd

Browse files
authored
Merge pull request github#12148 from jketema/opt-in
C++: Revert `semmle.code.cpp.dataflow` to its old state
2 parents ffbaef8 + 1a83b71 commit 8522edd

File tree

93 files changed

+149
-280
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+149
-280
lines changed

config/identical-files.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl6.qll",
99
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplForSerializability.qll",
1010
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplForOnActivityResult.qll",
11-
"cpp/ql/lib/semmle/code/cpp/dataflow/old/internal/DataFlowImpl.qll",
12-
"cpp/ql/lib/semmle/code/cpp/dataflow/old/internal/DataFlowImpl2.qll",
13-
"cpp/ql/lib/semmle/code/cpp/dataflow/old/internal/DataFlowImpl3.qll",
14-
"cpp/ql/lib/semmle/code/cpp/dataflow/old/internal/DataFlowImpl4.qll",
15-
"cpp/ql/lib/semmle/code/cpp/dataflow/old/internal/DataFlowImplLocal.qll",
11+
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll",
12+
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll",
13+
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll",
14+
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll",
15+
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll",
1616
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll",
1717
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll",
1818
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll",
@@ -43,7 +43,7 @@
4343
],
4444
"DataFlow Java/C++/C#/Go/Python/Ruby/Swift Common": [
4545
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll",
46-
"cpp/ql/lib/semmle/code/cpp/dataflow/old/internal/DataFlowImplCommon.qll",
46+
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll",
4747
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll",
4848
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll",
4949
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplCommon.qll",
@@ -52,9 +52,9 @@
5252
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplCommon.qll",
5353
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplCommon.qll"
5454
],
55-
"TaintTracking::Configuration Java/C++/C#/Go/Python/Ruby/Swift": [
56-
"cpp/ql/lib/semmle/code/cpp/dataflow/old/internal/tainttracking1/TaintTrackingImpl.qll",
57-
"cpp/ql/lib/semmle/code/cpp/dataflow/old/internal/tainttracking2/TaintTrackingImpl.qll",
55+
"TaintTracking::Configuration Java/C++/C#/Go/Python/Ruby/Swift": [
56+
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
57+
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/tainttracking2/TaintTrackingImpl.qll",
5858
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
5959
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/tainttracking2/TaintTrackingImpl.qll",
6060
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/tainttracking3/TaintTrackingImpl.qll",
@@ -80,7 +80,7 @@
8080
],
8181
"DataFlow Java/C++/C#/Python/Ruby/Swift Consistency checks": [
8282
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll",
83-
"cpp/ql/lib/semmle/code/cpp/dataflow/old/internal/DataFlowImplConsistency.qll",
83+
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplConsistency.qll",
8484
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll",
8585
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll",
8686
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplConsistency.qll",
@@ -122,7 +122,7 @@
122122
],
123123
"C++ SubBasicBlocks": [
124124
"cpp/ql/lib/semmle/code/cpp/controlflow/SubBasicBlocks.qll",
125-
"cpp/ql/lib/semmle/code/cpp/dataflow/old/internal/SubBasicBlocks.qll"
125+
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/SubBasicBlocks.qll"
126126
],
127127
"IR Instruction": [
128128
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Instruction.qll",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: breaking
3+
---
4+
* The `semmle.code.cpp.commons.Buffer` and `semmle.code.cpp.commons.NullTermination` libraries no longer expose `semmle.code.cpp.dataflow.DataFlow`. Please import `semmle.code.cpp.dataflow.DataFlow` directly.

cpp/ql/lib/experimental/semmle/code/cpp/security/PrivateCleartextWrite.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
import cpp
6-
import semmle.code.cpp.dataflow.TaintTracking
6+
import semmle.code.cpp.ir.dataflow.TaintTracking
77
import semmle.code.cpp.security.PrivateData
88
import semmle.code.cpp.security.FileWrite
99
import semmle.code.cpp.security.BufferWrite

cpp/ql/lib/semmle/code/cpp/commons/Buffer.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import cpp
2-
import semmle.code.cpp.dataflow.DataFlow
2+
private import semmle.code.cpp.ir.dataflow.DataFlow
33

44
/**
55
* Holds if `v` is a member variable of `c` that looks like it might be variable sized

cpp/ql/lib/semmle/code/cpp/commons/NullTermination.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import cpp
22
private import semmle.code.cpp.models.interfaces.ArrayFunction
33
private import semmle.code.cpp.models.implementations.Strcat
4-
import semmle.code.cpp.dataflow.DataFlow
4+
private import semmle.code.cpp.ir.dataflow.DataFlow
55

66
/**
77
* Holds if the expression `e` assigns something including `va` to a

cpp/ql/lib/semmle/code/cpp/dataflow/DataFlow.qll

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
* _sink_.
55
*
66
* Unless configured otherwise, _flow_ means that the exact value of
7-
* the source may reach the sink.
7+
* the source may reach the sink. We do not track flow across pointer
8+
* dereferences or array indexing. To track these types of flow, where the
9+
* exact value may not be preserved, import
10+
* `semmle.code.cpp.dataflow.TaintTracking`.
811
*
912
* To use global (interprocedural) data flow, extend the class
1013
* `DataFlow::Configuration` as documented on that class. To use local
@@ -14,4 +17,12 @@
1417
* `DataFlow::Node`.
1518
*/
1619

17-
import semmle.code.cpp.ir.dataflow.DataFlow
20+
import cpp
21+
22+
/**
23+
* Provides classes for performing local (intra-procedural) and
24+
* global (inter-procedural) data flow analyses.
25+
*/
26+
module DataFlow {
27+
import semmle.code.cpp.dataflow.internal.DataFlowImpl
28+
}

cpp/ql/lib/semmle/code/cpp/dataflow/DataFlow2.qll

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,12 @@
99
* See `semmle.code.cpp.dataflow.DataFlow` for the full documentation.
1010
*/
1111

12-
import semmle.code.cpp.ir.dataflow.DataFlow2
12+
import cpp
13+
14+
/**
15+
* Provides classes for performing local (intra-procedural) and
16+
* global (inter-procedural) data flow analyses.
17+
*/
18+
module DataFlow2 {
19+
import semmle.code.cpp.dataflow.internal.DataFlowImpl2
20+
}

cpp/ql/lib/semmle/code/cpp/dataflow/DataFlow3.qll

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,12 @@
99
* See `semmle.code.cpp.dataflow.DataFlow` for the full documentation.
1010
*/
1111

12-
import semmle.code.cpp.ir.dataflow.DataFlow3
12+
import cpp
13+
14+
/**
15+
* Provides classes for performing local (intra-procedural) and
16+
* global (inter-procedural) data flow analyses.
17+
*/
18+
module DataFlow3 {
19+
import semmle.code.cpp.dataflow.internal.DataFlowImpl3
20+
}

cpp/ql/lib/semmle/code/cpp/dataflow/DataFlow4.qll

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,12 @@
99
* See `semmle.code.cpp.dataflow.DataFlow` for the full documentation.
1010
*/
1111

12-
import semmle.code.cpp.ir.dataflow.DataFlow4
12+
import cpp
13+
14+
/**
15+
* Provides classes for performing local (intra-procedural) and
16+
* global (inter-procedural) data flow analyses.
17+
*/
18+
module DataFlow4 {
19+
import semmle.code.cpp.dataflow.internal.DataFlowImpl4
20+
}

cpp/ql/lib/semmle/code/cpp/dataflow/TaintTracking.qll

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,13 @@
1515
* `TaintTracking::localTaintStep` with arguments of type `DataFlow::Node`.
1616
*/
1717

18-
import semmle.code.cpp.ir.dataflow.TaintTracking
18+
import semmle.code.cpp.dataflow.DataFlow
19+
import semmle.code.cpp.dataflow.DataFlow2
20+
21+
/**
22+
* Provides classes for performing local (intra-procedural) and
23+
* global (inter-procedural) taint-tracking analyses.
24+
*/
25+
module TaintTracking {
26+
import semmle.code.cpp.dataflow.internal.tainttracking1.TaintTrackingImpl
27+
}

0 commit comments

Comments
 (0)