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
66import semmle.code.csharp.controlflow.internal.Splitting
77import Consistency
88
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+
921predicate bbStartInconsistency ( ControlFlowElement cfe ) {
10- exists ( ControlFlow :: BasicBlock bb | bb .getFirstNode ( ) = cfe .getAControlFlowNode ( ) ) and
22+ exists ( RelevantBasicBlock bb | bb .getFirstNode ( ) = cfe .getAControlFlowNode ( ) ) and
1123 not cfe = any ( PreBasicBlock bb ) .getFirstElement ( )
1224}
1325
1426predicate bbSuccInconsistency ( ControlFlowElement pred , ControlFlowElement succ ) {
15- exists ( ControlFlow :: BasicBlock predBB , ControlFlow :: BasicBlock succBB |
27+ exists ( RelevantBasicBlock predBB , RelevantBasicBlock succBB |
1628 predBB .getLastNode ( ) = pred .getAControlFlowNode ( ) and
1729 succBB = predBB .getASuccessor ( ) and
1830 succBB .getFirstNode ( ) = succ .getAControlFlowNode ( )
You can’t perform that action at this time.
0 commit comments