We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7dbe29 commit 70d530aCopy full SHA for 70d530a
rust/ql/src/queries/unusedentities/UnreachableCode.ql
@@ -15,7 +15,10 @@ import codeql.rust.controlflow.internal.ControlFlowGraphImpl as ControlFlowGraph
15
/**
16
* Holds if `n` is an AST node that's unreachable.
17
*/
18
-private predicate unreachable(AstNode n) { not n = any(CfgNode cfn).getAstNode() }
+private predicate unreachable(AstNode n) {
19
+ not n = any(CfgNode cfn).getAstNode() and // reachable nodes
20
+ n instanceof ControlFlowGraphImpl::ControlFlowTree // part of the CFG
21
+}
22
23
24
* Holds if `n` is an AST node that's unreachable, and is not the successor
0 commit comments