File tree Expand file tree Collapse file tree 2 files changed +71
-65
lines changed
lib/codeql/swift/controlflow/internal
test/library-tests/controlflow/graph Expand file tree Collapse file tree 2 files changed +71
-65
lines changed Original file line number Diff line number Diff line change @@ -265,11 +265,22 @@ private predicate isIrrefutableMatch(Pattern p) {
265
265
isIrrefutableMatch ( p .getResolveStep ( ) )
266
266
}
267
267
268
+ /**
269
+ * Holds if the ast node `ast` is a (possibly top-level) pattern that constantly matches (`value = true`) or
270
+ * constantly non-matches (`value = false`).
271
+ */
272
+ private predicate isMatchingConstant ( AstNode ast , boolean value ) {
273
+ isMatchingConstantItem ( ast , value )
274
+ or
275
+ isIrrefutableMatch ( ast ) and
276
+ value = true
277
+ }
278
+
268
279
/**
269
280
* Holds if the top-level pattern `cli` constantly matches (`value = true`) or
270
281
* constantly non-matches (`value = false`).
271
282
*/
272
- private predicate isMatchingConstant ( CaseLabelItem cli , boolean value ) {
283
+ private predicate isMatchingConstantItem ( CaseLabelItem cli , boolean value ) {
273
284
// If the pattern always matches
274
285
isIrrefutableMatch ( cli .getPattern ( ) ) and
275
286
(
You can’t perform that action at this time.
0 commit comments