Skip to content

Commit 657cd89

Browse files
authored
Merge pull request github#7347 from hvitved/cfg/more-consistency-tests
Shared CFG: Add two more consistency queries
2 parents 13f7fd8 + 70f76d0 commit 657cd89

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

csharp/ql/lib/semmle/code/csharp/controlflow/internal/ControlFlowGraphImplShared.qll

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,4 +988,14 @@ module Consistency {
988988
not node instanceof TExitNode and
989989
not exists(getASuccessor(node, _))
990990
}
991+
992+
query predicate nonUniqueSplitKind(SplitImpl split, SplitKind sk) {
993+
sk = split.getKind() and
994+
strictcount(split.getKind()) > 1
995+
}
996+
997+
query predicate nonUniqueListOrder(SplitKind sk, int ord) {
998+
ord = sk.getListOrder() and
999+
strictcount(sk.getListOrder()) > 1
1000+
}
9911001
}

ruby/ql/lib/codeql/ruby/controlflow/internal/ControlFlowGraphImplShared.qll

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,4 +988,14 @@ module Consistency {
988988
not node instanceof TExitNode and
989989
not exists(getASuccessor(node, _))
990990
}
991+
992+
query predicate nonUniqueSplitKind(SplitImpl split, SplitKind sk) {
993+
sk = split.getKind() and
994+
strictcount(split.getKind()) > 1
995+
}
996+
997+
query predicate nonUniqueListOrder(SplitKind sk, int ord) {
998+
ord = sk.getListOrder() and
999+
strictcount(sk.getListOrder()) > 1
1000+
}
9911001
}

0 commit comments

Comments
 (0)