mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Avoid bad join in compatibleTypesCached
This is identical to the code in Ruby and seems to prevent a bad join ordering in a cached version of this predicate in DataFlowCommon
This commit is contained in:
@@ -373,13 +373,19 @@ predicate neverSkipInPathGraph(Node node) {
|
||||
|
||||
string ppReprType(DataFlowType t) { none() }
|
||||
|
||||
pragma[inline]
|
||||
private predicate compatibleTypesNonSymRefl(DataFlowType t1, DataFlowType t2) {
|
||||
t1 != TAnyType() and
|
||||
t2 = TAnyType()
|
||||
}
|
||||
|
||||
pragma[inline]
|
||||
predicate compatibleTypes(DataFlowType t1, DataFlowType t2) {
|
||||
t1 = t2
|
||||
or
|
||||
t1 instanceof TAnyType and exists(t2)
|
||||
compatibleTypesNonSymRefl(t1, t2)
|
||||
or
|
||||
t2 instanceof TAnyType and exists(t1)
|
||||
compatibleTypesNonSymRefl(t2, t1)
|
||||
}
|
||||
|
||||
predicate forceHighPrecision(Content c) { none() }
|
||||
|
||||
Reference in New Issue
Block a user