Skip to content

Commit fd83241

Browse files
committed
Dataflow: Add empty type strengthening predicate for languages without type pruning.
1 parent 96c1b5b commit fd83241

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowPrivate.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ predicate clearsContent(Node n, Content c) {
205205
*/
206206
predicate expectsContent(Node n, ContentSet c) { none() }
207207

208+
predicate typeStrongerThan(DataFlowType t1, DataFlowType t2) { none() }
209+
208210
/** Gets the type of `n` used for type pruning. */
209211
Type getNodeType(Node n) {
210212
suppressUnusedNode(n) and

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,8 @@ predicate clearsContent(Node n, Content c) {
753753
*/
754754
predicate expectsContent(Node n, ContentSet c) { none() }
755755

756+
predicate typeStrongerThan(DataFlowType t1, DataFlowType t2) { none() }
757+
756758
/** Gets the type of `n` used for type pruning. */
757759
DataFlowType getNodeType(Node n) {
758760
suppressUnusedNode(n) and

go/ql/lib/semmle/go/dataflow/internal/DataFlowPrivate.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ predicate expectsContent(Node n, ContentSet c) {
200200
FlowSummaryImpl::Private::Steps::summaryExpectsContent(n, c)
201201
}
202202

203+
predicate typeStrongerThan(DataFlowType t1, DataFlowType t2) { none() }
204+
203205
/** Gets the type of `n` used for type pruning. */
204206
DataFlowType getNodeType(Node n) { result = TTodoDataFlowType() and exists(n) }
205207

python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPrivate.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,8 @@ class CastNode extends Node {
502502
pragma[inline]
503503
predicate compatibleTypes(DataFlowType t1, DataFlowType t2) { any() }
504504

505+
predicate typeStrongerThan(DataFlowType t1, DataFlowType t2) { none() }
506+
505507
/**
506508
* Gets the type of `node`.
507509
*/

ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,8 @@ class DataFlowType extends TDataFlowType {
12311231
string toString() { result = "" }
12321232
}
12331233

1234+
predicate typeStrongerThan(DataFlowType t1, DataFlowType t2) { none() }
1235+
12341236
/** Gets the type of `n` used for type pruning. */
12351237
DataFlowType getNodeType(NodeImpl n) { result = TTodoDataFlowType() and exists(n) }
12361238

swift/ql/lib/codeql/swift/dataflow/internal/DataFlowPrivate.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,8 @@ class DataFlowType extends TDataFlowType {
793793
string toString() { result = "" }
794794
}
795795

796+
predicate typeStrongerThan(DataFlowType t1, DataFlowType t2) { none() }
797+
796798
/** Gets the type of `n` used for type pruning. */
797799
DataFlowType getNodeType(NodeImpl n) {
798800
any() // return the singleton DataFlowType until we support type pruning for Swift

0 commit comments

Comments
 (0)