File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
csharp/ql/consistency-queries Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,25 @@ import semmle.code.csharp.controlflow.internal.ControlFlowGraphImpl
6
6
import semmle.code.csharp.controlflow.internal.Splitting
7
7
import Consistency
8
8
9
+ private predicate splitBB ( ControlFlow:: BasicBlock bb ) {
10
+ exists ( ControlFlow:: Node first |
11
+ first = bb .getFirstNode ( ) and
12
+ first .isJoin ( ) and
13
+ strictcount ( first .getAPredecessor ( ) .getElement ( ) ) = 1
14
+ )
15
+ }
16
+
17
+ private class RelevantBasicBlock extends ControlFlow:: BasicBlock {
18
+ RelevantBasicBlock ( ) { not splitBB ( this ) }
19
+ }
20
+
9
21
predicate bbStartInconsistency ( ControlFlowElement cfe ) {
10
- exists ( ControlFlow :: BasicBlock bb | bb .getFirstNode ( ) = cfe .getAControlFlowNode ( ) ) and
22
+ exists ( RelevantBasicBlock bb | bb .getFirstNode ( ) = cfe .getAControlFlowNode ( ) ) and
11
23
not cfe = any ( PreBasicBlock bb ) .getFirstElement ( )
12
24
}
13
25
14
26
predicate bbSuccInconsistency ( ControlFlowElement pred , ControlFlowElement succ ) {
15
- exists ( ControlFlow :: BasicBlock predBB , ControlFlow :: BasicBlock succBB |
27
+ exists ( RelevantBasicBlock predBB , RelevantBasicBlock succBB |
16
28
predBB .getLastNode ( ) = pred .getAControlFlowNode ( ) and
17
29
succBB = predBB .getASuccessor ( ) and
18
30
succBB .getFirstNode ( ) = succ .getAControlFlowNode ( )
You can’t perform that action at this time.
0 commit comments