mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Dataflow: Add empty type strengthening predicate for languages without type pruning.
This commit is contained in:
@@ -205,6 +205,8 @@ predicate clearsContent(Node n, Content c) {
|
|||||||
*/
|
*/
|
||||||
predicate expectsContent(Node n, ContentSet c) { none() }
|
predicate expectsContent(Node n, ContentSet c) { none() }
|
||||||
|
|
||||||
|
predicate typeStrongerThan(DataFlowType t1, DataFlowType t2) { none() }
|
||||||
|
|
||||||
/** Gets the type of `n` used for type pruning. */
|
/** Gets the type of `n` used for type pruning. */
|
||||||
Type getNodeType(Node n) {
|
Type getNodeType(Node n) {
|
||||||
suppressUnusedNode(n) and
|
suppressUnusedNode(n) and
|
||||||
|
|||||||
@@ -753,6 +753,8 @@ predicate clearsContent(Node n, Content c) {
|
|||||||
*/
|
*/
|
||||||
predicate expectsContent(Node n, ContentSet c) { none() }
|
predicate expectsContent(Node n, ContentSet c) { none() }
|
||||||
|
|
||||||
|
predicate typeStrongerThan(DataFlowType t1, DataFlowType t2) { none() }
|
||||||
|
|
||||||
/** Gets the type of `n` used for type pruning. */
|
/** Gets the type of `n` used for type pruning. */
|
||||||
DataFlowType getNodeType(Node n) {
|
DataFlowType getNodeType(Node n) {
|
||||||
suppressUnusedNode(n) and
|
suppressUnusedNode(n) and
|
||||||
|
|||||||
@@ -200,6 +200,8 @@ predicate expectsContent(Node n, ContentSet c) {
|
|||||||
FlowSummaryImpl::Private::Steps::summaryExpectsContent(n, c)
|
FlowSummaryImpl::Private::Steps::summaryExpectsContent(n, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
predicate typeStrongerThan(DataFlowType t1, DataFlowType t2) { none() }
|
||||||
|
|
||||||
/** Gets the type of `n` used for type pruning. */
|
/** Gets the type of `n` used for type pruning. */
|
||||||
DataFlowType getNodeType(Node n) { result = TTodoDataFlowType() and exists(n) }
|
DataFlowType getNodeType(Node n) { result = TTodoDataFlowType() and exists(n) }
|
||||||
|
|
||||||
|
|||||||
@@ -502,6 +502,8 @@ class CastNode extends Node {
|
|||||||
pragma[inline]
|
pragma[inline]
|
||||||
predicate compatibleTypes(DataFlowType t1, DataFlowType t2) { any() }
|
predicate compatibleTypes(DataFlowType t1, DataFlowType t2) { any() }
|
||||||
|
|
||||||
|
predicate typeStrongerThan(DataFlowType t1, DataFlowType t2) { none() }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the type of `node`.
|
* Gets the type of `node`.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1231,6 +1231,8 @@ class DataFlowType extends TDataFlowType {
|
|||||||
string toString() { result = "" }
|
string toString() { result = "" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
predicate typeStrongerThan(DataFlowType t1, DataFlowType t2) { none() }
|
||||||
|
|
||||||
/** Gets the type of `n` used for type pruning. */
|
/** Gets the type of `n` used for type pruning. */
|
||||||
DataFlowType getNodeType(NodeImpl n) { result = TTodoDataFlowType() and exists(n) }
|
DataFlowType getNodeType(NodeImpl n) { result = TTodoDataFlowType() and exists(n) }
|
||||||
|
|
||||||
|
|||||||
@@ -793,6 +793,8 @@ class DataFlowType extends TDataFlowType {
|
|||||||
string toString() { result = "" }
|
string toString() { result = "" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
predicate typeStrongerThan(DataFlowType t1, DataFlowType t2) { none() }
|
||||||
|
|
||||||
/** Gets the type of `n` used for type pruning. */
|
/** Gets the type of `n` used for type pruning. */
|
||||||
DataFlowType getNodeType(NodeImpl n) {
|
DataFlowType getNodeType(NodeImpl n) {
|
||||||
any() // return the singleton DataFlowType until we support type pruning for Swift
|
any() // return the singleton DataFlowType until we support type pruning for Swift
|
||||||
|
|||||||
Reference in New Issue
Block a user