Skip to content

Commit 3440aa3

Browse files
committed
Use instanceof
1 parent 9a69103 commit 3440aa3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

java/ql/lib/semmle/code/java/controlflow/UnreachableBlocks.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class UnreachableBasicBlock extends BasicBlock {
211211
// expression in an assert statement, or a catch clause.
212212
forall(BasicBlock bb | bb = this.getABBPredecessor() | bb instanceof UnreachableBasicBlock) and
213213
not exists(Callable c | c.getBody().getControlFlowNode() = this.getFirstNode()) and
214-
not exists(AssertStmt a | a = this.getFirstNode().asExpr().getEnclosingStmt()) and
214+
not this.getFirstNode().asExpr().getEnclosingStmt() instanceof AssertStmt and
215215
not this.getFirstNode().asStmt() instanceof CatchClause
216216
or
217217
// Switch statements with a constant comparison expression may have unreachable cases.

0 commit comments

Comments
 (0)