Skip to content

Commit f1f964c

Browse files
authored
Merge pull request #22423 from yoff/yoff-abrupt-origin-consistency
2 parents cf26b00 + 7f8a20e commit f1f964c

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎shared/controlflow/codeql/controlflow/ControlFlowGraph.qll‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,6 +2264,12 @@ module Make0<LocationSig Location, AstSig<Location> Ast> {
22642264
query = "ambiguousAdditionalNode" and
22652265
results = strictcount(AstNode n, string tag | ambiguousAdditionalNode(n, tag))
22662266
or
2267+
query = "invalidAbruptCompletionOrigin" and
2268+
results =
2269+
strictcount(AstNode ast, PreControlFlowNode node |
2270+
invalidAbruptCompletionOrigin(ast, node)
2271+
)
2272+
or
22672273
query = "missingInNodeForPostOrInOrder" and
22682274
results = strictcount(AstNode ast | missingInNodeForPostOrInOrder(ast))
22692275
or
@@ -2351,6 +2357,16 @@ module Make0<LocationSig Location, AstSig<Location> Ast> {
23512357
1 < strictcount(NormalSuccessor t | additionalNode(n, tag, t))
23522358
}
23532359

2360+
/**
2361+
* Holds if the language-specific CFG input supplies an abrupt completion for `ast` whose
2362+
* origin `node` does not belong to `ast`.
2363+
*/
2364+
query predicate invalidAbruptCompletionOrigin(AstNode ast, PreControlFlowNode node) {
2365+
Input2::beginAbruptCompletion(ast, node, _, _) and
2366+
not node.isIn(ast) and
2367+
not node.isAdditional(ast, _)
2368+
}
2369+
23542370
/**
23552371
* Holds if the "in" node is unreachable for a post-or-in-order AST node.
23562372
*

0 commit comments

Comments
 (0)