mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Extract container of adapter function as compiler generated
This commit is contained in:
@@ -1222,3 +1222,9 @@ ktPropertyDelegates(
|
||||
unique int id: @kt_property ref,
|
||||
unique int variableId: @variable ref
|
||||
)
|
||||
|
||||
compiler_generated(
|
||||
unique int id: @top ref,
|
||||
int kind: int ref
|
||||
// 1: Kotlin declaring classes of adapter functions
|
||||
);
|
||||
|
||||
@@ -50,7 +50,9 @@ predicate dead(RefType dead) {
|
||||
// Exclude classes that look like they may be reflectively constructed.
|
||||
not dead.getAnAnnotation() instanceof ReflectiveAccessAnnotation and
|
||||
// Insist all source ancestors are dead as well.
|
||||
forall(RefType t | t.fromSource() and t = getASuperTypePlus(dead) | dead(t))
|
||||
forall(RefType t | t.fromSource() and t = getASuperTypePlus(dead) | dead(t)) and
|
||||
// Exclude compiler generated classes (e.g. declaring type of adapter functions in Kotlin)
|
||||
not compiler_generated(dead, _)
|
||||
}
|
||||
|
||||
from RefType t, string kind
|
||||
|
||||
@@ -228,3 +228,5 @@ modifiers
|
||||
| reflection.kt:116:40:116:44 | ...::... | reflection.kt:116:40:116:44 | invoke | override |
|
||||
| reflection.kt:116:40:116:44 | ...::... | reflection.kt:116:40:116:44 | invoke | public |
|
||||
| reflection.kt:126:9:126:13 | ...::... | reflection.kt:126:9:126:13 | invoke | public |
|
||||
compGenerated
|
||||
| reflection.kt:126:9:126:13 | | 1 |
|
||||
|
||||
@@ -86,3 +86,5 @@ query predicate modifiers(ClassInstanceExpr e, Method m, string modifier) {
|
||||
e.getAnonymousClass().getAMethod() = m and
|
||||
m.hasModifier(modifier)
|
||||
}
|
||||
|
||||
query predicate compGenerated(Top t, int i) { compiler_generated(t, i) }
|
||||
|
||||
Reference in New Issue
Block a user