Skip to content

Commit 903e4f5

Browse files
committed
Exclude error types from contradictory-type-check query
1 parent 140c318 commit 903e4f5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

java/ql/src/Likely Bugs/Likely Typos/ContradictoryTypeChecks.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ predicate contradictoryTypeCheck(Expr e, Variable v, RefType t, RefType sup, Exp
4040
requiresInstanceOf(e, ssa.getAUse(), t) and
4141
sup = t.getAnAncestor() and
4242
instanceOfCheck(cond, ssa.getAUse(), sup) and
43-
cond.(Guard).controls(e.getBasicBlock(), false)
43+
cond.(Guard).controls(e.getBasicBlock(), false) and
44+
not t instanceof ErrorType and
45+
not sup instanceof ErrorType
4446
)
4547
}
4648

0 commit comments

Comments
 (0)