mirror of
https://github.com/github/codeql.git
synced 2026-03-01 21:34:50 +01:00
Java: Improve join-order by properly annotating haveIntersection.
This commit is contained in:
@@ -1261,14 +1261,21 @@ private Type erase(Type t) {
|
||||
*
|
||||
* For the definition of the notion of *erasure* see JLS v8, section 4.6 (Type Erasure).
|
||||
*/
|
||||
bindingset[t1, t2]
|
||||
overlay[caller?]
|
||||
pragma[inline]
|
||||
pragma[inline_late]
|
||||
predicate haveIntersection(RefType t1, RefType t2) {
|
||||
exists(RefType e1, RefType e2 | e1 = erase(t1) and e2 = erase(t2) |
|
||||
erasedHaveIntersection(e1, e2)
|
||||
erasedHaveIntersectionFilter(e1, e2)
|
||||
)
|
||||
}
|
||||
|
||||
bindingset[t1, t2]
|
||||
pragma[inline_late]
|
||||
private predicate erasedHaveIntersectionFilter(RefType t1, RefType t2) {
|
||||
erasedHaveIntersection(t1, t2)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if there is no common (reflexive, transitive) subtype of the erasures
|
||||
* of types `t1` and `t2`.
|
||||
|
||||
Reference in New Issue
Block a user