Skip to content

Commit 9fc8f61

Browse files
committed
C#: Introduce ControlFlowElementOrCallable.
1 parent c803fbc commit 9fc8f61

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

csharp/ql/lib/semmle/code/csharp/Callable.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ private import TypeRef
2222
* an anonymous function (`AnonymousFunctionExpr`), or a local function
2323
* (`LocalFunction`).
2424
*/
25-
class Callable extends Parameterizable, ExprOrStmtParent, @callable {
25+
class Callable extends Parameterizable, ControlFlowElementOrCallable, @callable {
2626
/** Gets the return type of this callable. */
2727
Type getReturnType() { none() }
2828

csharp/ql/lib/semmle/code/csharp/controlflow/ControlFlowElement.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ private import ControlFlow::BasicBlocks
88
private import semmle.code.csharp.Caching
99
private import internal.ControlFlowGraphImpl as Impl
1010

11+
private class TControlFlowElementOrCallable = @callable or @control_flow_element;
12+
13+
class ControlFlowElementOrCallable extends ExprOrStmtParent, TControlFlowElementOrCallable { }
14+
1115
/**
1216
* A program element that can possess control flow. That is, either a statement or
1317
* an expression.
@@ -17,7 +21,7 @@ private import internal.ControlFlowGraphImpl as Impl
1721
* control flow elements and control flow nodes. This allows control flow
1822
* splitting, for example modeling the control flow through `finally` blocks.
1923
*/
20-
class ControlFlowElement extends ExprOrStmtParent, @control_flow_element {
24+
class ControlFlowElement extends ControlFlowElementOrCallable, @control_flow_element {
2125
/** Gets the enclosing callable of this element, if any. */
2226
Callable getEnclosingCallable() { none() }
2327

0 commit comments

Comments
 (0)