Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d0f63ca

Browse files
committed
C#: Introduce SplitKind class
1 parent c4a167c commit d0f63ca

8 files changed

Lines changed: 458 additions & 293 deletions

File tree

csharp/ql/src/semmle/code/csharp/controlflow/ControlFlowGraph.qll

Lines changed: 306 additions & 141 deletions
Large diffs are not rendered by default.

csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@
5656
| CatchInFinally.cs:17:41:17:43 | "1" | CatchInFinally.cs:17:27:17:44 | object creation of type Exception | 2 |
5757
| CatchInFinally.cs:17:41:17:43 | [finally: exception(ArgumentNullException)] "1" | CatchInFinally.cs:17:27:17:44 | [finally: exception(ArgumentNullException)] object creation of type Exception | 2 |
5858
| CatchInFinally.cs:17:41:17:43 | [finally: exception(Exception)] "1" | CatchInFinally.cs:17:27:17:44 | [finally: exception(Exception)] object creation of type Exception | 2 |
59-
| CatchInFinally.cs:19:13:22:13 | [exception: Exception, finally: exception(ArgumentNullException)] catch (...) {...} | CatchInFinally.cs:19:39:19:54 | [exception: Exception, finally: exception(ArgumentNullException)] ... == ... | 6 |
60-
| CatchInFinally.cs:19:13:22:13 | [exception: Exception, finally: exception(Exception)] catch (...) {...} | CatchInFinally.cs:19:39:19:54 | [exception: Exception, finally: exception(Exception)] ... == ... | 6 |
6159
| CatchInFinally.cs:19:13:22:13 | [exception: Exception] catch (...) {...} | CatchInFinally.cs:19:39:19:54 | [exception: Exception] ... == ... | 6 |
62-
| CatchInFinally.cs:19:13:22:13 | [exception: NullReferenceException, finally: exception(ArgumentNullException)] catch (...) {...} | CatchInFinally.cs:19:39:19:54 | [exception: NullReferenceException, finally: exception(ArgumentNullException)] ... == ... | 6 |
63-
| CatchInFinally.cs:19:13:22:13 | [exception: NullReferenceException, finally: exception(Exception)] catch (...) {...} | CatchInFinally.cs:19:39:19:54 | [exception: NullReferenceException, finally: exception(Exception)] ... == ... | 6 |
6460
| CatchInFinally.cs:19:13:22:13 | [exception: NullReferenceException] catch (...) {...} | CatchInFinally.cs:19:39:19:54 | [exception: NullReferenceException] ... == ... | 6 |
61+
| CatchInFinally.cs:19:13:22:13 | [finally: exception(ArgumentNullException), exception: Exception] catch (...) {...} | CatchInFinally.cs:19:39:19:54 | [finally: exception(ArgumentNullException), exception: Exception] ... == ... | 6 |
62+
| CatchInFinally.cs:19:13:22:13 | [finally: exception(ArgumentNullException), exception: NullReferenceException] catch (...) {...} | CatchInFinally.cs:19:39:19:54 | [finally: exception(ArgumentNullException), exception: NullReferenceException] ... == ... | 6 |
63+
| CatchInFinally.cs:19:13:22:13 | [finally: exception(Exception), exception: Exception] catch (...) {...} | CatchInFinally.cs:19:39:19:54 | [finally: exception(Exception), exception: Exception] ... == ... | 6 |
64+
| CatchInFinally.cs:19:13:22:13 | [finally: exception(Exception), exception: NullReferenceException] catch (...) {...} | CatchInFinally.cs:19:39:19:54 | [finally: exception(Exception), exception: NullReferenceException] ... == ... | 6 |
6565
| CatchInFinally.cs:20:13:22:13 | [finally: exception(ArgumentNullException)] {...} | CatchInFinally.cs:21:17:21:42 | [finally: exception(ArgumentNullException)] call to method WriteLine | 6 |
6666
| CatchInFinally.cs:20:13:22:13 | [finally: exception(Exception)] {...} | CatchInFinally.cs:21:17:21:42 | [finally: exception(Exception)] call to method WriteLine | 6 |
6767
| CatchInFinally.cs:20:13:22:13 | {...} | CatchInFinally.cs:21:17:21:42 | call to method WriteLine | 6 |

csharp/ql/test/library-tests/controlflow/graph/BasicBlockDominance.expected

Lines changed: 28 additions & 28 deletions
Large diffs are not rendered by default.

csharp/ql/test/library-tests/controlflow/graph/ConditionBlock.expected

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@
4040
| CatchInFinally.cs:9:17:9:28 | ... == ... | CatchInFinally.cs:17:41:17:43 | "1" | false |
4141
| CatchInFinally.cs:9:17:9:28 | ... == ... | CatchInFinally.cs:17:41:17:43 | [finally: exception(ArgumentNullException)] "1" | true |
4242
| CatchInFinally.cs:9:17:9:28 | ... == ... | CatchInFinally.cs:17:41:17:43 | [finally: exception(Exception)] "1" | true |
43-
| CatchInFinally.cs:9:17:9:28 | ... == ... | CatchInFinally.cs:19:13:22:13 | [exception: Exception, finally: exception(ArgumentNullException)] catch (...) {...} | true |
44-
| CatchInFinally.cs:9:17:9:28 | ... == ... | CatchInFinally.cs:19:13:22:13 | [exception: Exception, finally: exception(Exception)] catch (...) {...} | true |
4543
| CatchInFinally.cs:9:17:9:28 | ... == ... | CatchInFinally.cs:19:13:22:13 | [exception: Exception] catch (...) {...} | false |
46-
| CatchInFinally.cs:9:17:9:28 | ... == ... | CatchInFinally.cs:19:13:22:13 | [exception: NullReferenceException, finally: exception(ArgumentNullException)] catch (...) {...} | true |
47-
| CatchInFinally.cs:9:17:9:28 | ... == ... | CatchInFinally.cs:19:13:22:13 | [exception: NullReferenceException, finally: exception(Exception)] catch (...) {...} | true |
4844
| CatchInFinally.cs:9:17:9:28 | ... == ... | CatchInFinally.cs:19:13:22:13 | [exception: NullReferenceException] catch (...) {...} | false |
45+
| CatchInFinally.cs:9:17:9:28 | ... == ... | CatchInFinally.cs:19:13:22:13 | [finally: exception(ArgumentNullException), exception: Exception] catch (...) {...} | true |
46+
| CatchInFinally.cs:9:17:9:28 | ... == ... | CatchInFinally.cs:19:13:22:13 | [finally: exception(ArgumentNullException), exception: NullReferenceException] catch (...) {...} | true |
47+
| CatchInFinally.cs:9:17:9:28 | ... == ... | CatchInFinally.cs:19:13:22:13 | [finally: exception(Exception), exception: Exception] catch (...) {...} | true |
48+
| CatchInFinally.cs:9:17:9:28 | ... == ... | CatchInFinally.cs:19:13:22:13 | [finally: exception(Exception), exception: NullReferenceException] catch (...) {...} | true |
4949
| CatchInFinally.cs:9:17:9:28 | ... == ... | CatchInFinally.cs:20:13:22:13 | [finally: exception(ArgumentNullException)] {...} | true |
5050
| CatchInFinally.cs:9:17:9:28 | ... == ... | CatchInFinally.cs:20:13:22:13 | [finally: exception(Exception)] {...} | true |
5151
| CatchInFinally.cs:9:17:9:28 | ... == ... | CatchInFinally.cs:20:13:22:13 | {...} | false |

csharp/ql/test/library-tests/controlflow/graph/ConditionalFlow.expected

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@
3333
| 16 | 21 | CatchInFinally.cs:16:21:16:36 | ... == ... | true | 17 | 41 | CatchInFinally.cs:17:41:17:43 | "1" |
3434
| 16 | 21 | CatchInFinally.cs:16:21:16:36 | [finally: exception(ArgumentNullException)] ... == ... | true | 17 | 41 | CatchInFinally.cs:17:41:17:43 | [finally: exception(ArgumentNullException)] "1" |
3535
| 16 | 21 | CatchInFinally.cs:16:21:16:36 | [finally: exception(Exception)] ... == ... | true | 17 | 41 | CatchInFinally.cs:17:41:17:43 | [finally: exception(Exception)] "1" |
36-
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [exception: Exception, finally: exception(ArgumentNullException)] ... == ... | false | 23 | 13 | CatchInFinally.cs:23:13:26:13 | [finally: exception(ArgumentNullException)] catch {...} |
37-
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [exception: Exception, finally: exception(ArgumentNullException)] ... == ... | true | 20 | 13 | CatchInFinally.cs:20:13:22:13 | [finally: exception(ArgumentNullException)] {...} |
38-
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [exception: Exception, finally: exception(Exception)] ... == ... | false | 23 | 13 | CatchInFinally.cs:23:13:26:13 | [finally: exception(Exception)] catch {...} |
39-
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [exception: Exception, finally: exception(Exception)] ... == ... | true | 20 | 13 | CatchInFinally.cs:20:13:22:13 | [finally: exception(Exception)] {...} |
4036
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [exception: Exception] ... == ... | false | 23 | 13 | CatchInFinally.cs:23:13:26:13 | catch {...} |
4137
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [exception: Exception] ... == ... | true | 20 | 13 | CatchInFinally.cs:20:13:22:13 | {...} |
42-
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [exception: NullReferenceException, finally: exception(ArgumentNullException)] ... == ... | false | 23 | 13 | CatchInFinally.cs:23:13:26:13 | [finally: exception(ArgumentNullException)] catch {...} |
43-
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [exception: NullReferenceException, finally: exception(ArgumentNullException)] ... == ... | true | 20 | 13 | CatchInFinally.cs:20:13:22:13 | [finally: exception(ArgumentNullException)] {...} |
44-
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [exception: NullReferenceException, finally: exception(Exception)] ... == ... | false | 23 | 13 | CatchInFinally.cs:23:13:26:13 | [finally: exception(Exception)] catch {...} |
45-
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [exception: NullReferenceException, finally: exception(Exception)] ... == ... | true | 20 | 13 | CatchInFinally.cs:20:13:22:13 | [finally: exception(Exception)] {...} |
4638
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [exception: NullReferenceException] ... == ... | false | 23 | 13 | CatchInFinally.cs:23:13:26:13 | catch {...} |
4739
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [exception: NullReferenceException] ... == ... | true | 20 | 13 | CatchInFinally.cs:20:13:22:13 | {...} |
40+
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [finally: exception(ArgumentNullException), exception: Exception] ... == ... | false | 23 | 13 | CatchInFinally.cs:23:13:26:13 | [finally: exception(ArgumentNullException)] catch {...} |
41+
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [finally: exception(ArgumentNullException), exception: Exception] ... == ... | true | 20 | 13 | CatchInFinally.cs:20:13:22:13 | [finally: exception(ArgumentNullException)] {...} |
42+
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [finally: exception(ArgumentNullException), exception: NullReferenceException] ... == ... | false | 23 | 13 | CatchInFinally.cs:23:13:26:13 | [finally: exception(ArgumentNullException)] catch {...} |
43+
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [finally: exception(ArgumentNullException), exception: NullReferenceException] ... == ... | true | 20 | 13 | CatchInFinally.cs:20:13:22:13 | [finally: exception(ArgumentNullException)] {...} |
44+
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [finally: exception(Exception), exception: Exception] ... == ... | false | 23 | 13 | CatchInFinally.cs:23:13:26:13 | [finally: exception(Exception)] catch {...} |
45+
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [finally: exception(Exception), exception: Exception] ... == ... | true | 20 | 13 | CatchInFinally.cs:20:13:22:13 | [finally: exception(Exception)] {...} |
46+
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [finally: exception(Exception), exception: NullReferenceException] ... == ... | false | 23 | 13 | CatchInFinally.cs:23:13:26:13 | [finally: exception(Exception)] catch {...} |
47+
| 19 | 39 | CatchInFinally.cs:19:39:19:54 | [finally: exception(Exception), exception: NullReferenceException] ... == ... | true | 20 | 13 | CatchInFinally.cs:20:13:22:13 | [finally: exception(Exception)] {...} |
4848
| 21 | 21 | Switch.cs:21:21:21:29 | ... == ... | false | 23 | 27 | Switch.cs:23:27:23:27 | 0 |
4949
| 21 | 21 | Switch.cs:21:21:21:29 | ... == ... | true | 22 | 21 | Switch.cs:22:21:22:27 | return ...; |
5050
| 22 | 18 | cflow.cs:22:18:22:23 | ... < ... | false | 24 | 9 | cflow.cs:24:9:34:9 | for (...;...;...) ... |

0 commit comments

Comments
 (0)