diff --git a/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll b/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll index fff877b9fcd9..e917d7728862 100644 --- a/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll +++ b/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll @@ -2090,6 +2090,12 @@ module Make0 Ast> { module Consistency { /** Holds if the consistency query `query` has `results` results. */ query predicate consistencyOverview(string query, int results) { + query = "siblingsWithSameIndexInDefaultCfg" and + results = + strictcount(AstNode parent, AstNode child1, AstNode child2, int i | + siblingsWithSameIndexInDefaultCfg(parent, child1, child2, i) + ) + or query = "deadEnd" and results = strictcount(ControlFlowNode node | deadEnd(node)) or query = "nonUniqueEnclosingCallable" and @@ -2135,6 +2141,20 @@ module Make0 Ast> { results = strictcount(ControlFlowNode node, SuccessorType t | selfLoop(node, t)) } + /** + * Holds if `parent` uses default left-to-right control flow and has + * two different children `child1` and `child2` at the same index + * `i`. + */ + query predicate siblingsWithSameIndexInDefaultCfg( + AstNode parent, AstNode child1, AstNode child2, int i + ) { + defaultCfg(parent) and + getChild(parent, i) = child1 and + getChild(parent, i) = child2 and + child1 != child2 + } + /** * Holds if `node` is lacking a successor. *