Skip to content

Commit 35f9f7c

Browse files
committed
remove some benign results from ql/suggest-instanceof-extension
1 parent 618f48b commit 35f9f7c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ql/ql/src/codeql_ql/style/UseInstanceofExtensionQuery.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ predicate instanceofThisInCharPred(Class c, Type type) {
1414
|
1515
instanceOf.getExpr() instanceof ThisAccess and
1616
type = instanceOf.getType().getResolvedType()
17-
)
17+
) and
18+
// no existing super-type corresponds to the instanceof type, that is benign.
19+
not c.getASuperType().getResolvedType() = type
1820
}
1921

2022
/** Gets an inline cast that cases `this` to `type` inside a class predicate for `c`. */

0 commit comments

Comments
 (0)