File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed
lib/codeql/swift/dataflow/internal
test/library-tests/dataflow/dataflow Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,19 @@ abstract class ReturnNode extends Node {
155
155
abstract ReturnKind getKind ( ) ;
156
156
}
157
157
158
- private module ReturnNodes { }
158
+ private module ReturnNodes {
159
+ class ReturnReturnNode extends ReturnNode , ExprNode {
160
+ ReturnReturnNode ( ) {
161
+ exists ( ReturnStmt stmt |
162
+ stmt .getResult ( ) = this .asExpr ( )
163
+ )
164
+ }
165
+
166
+ override ReturnKind getKind ( ) {
167
+ result instanceof NormalReturnKind
168
+ }
169
+ }
170
+ }
159
171
160
172
import ReturnNodes
161
173
@@ -165,7 +177,13 @@ abstract class OutNode extends Node {
165
177
abstract DataFlowCall getCall ( ReturnKind kind ) ;
166
178
}
167
179
168
- private module OutNodes { }
180
+ private module OutNodes {
181
+ class CallOutNode extends OutNode , DataFlowCall {
182
+ override DataFlowCall getCall ( ReturnKind kind ) {
183
+ result = this and kind instanceof NormalReturnKind
184
+ }
185
+ }
186
+ }
169
187
170
188
import OutNodes
171
189
Original file line number Diff line number Diff line change 6
6
| test.swift:25:20:25:27 | CallExpr : | test.swift:28:18:28:21 | WriteDef : |
7
7
| test.swift:28:18:28:21 | ParamDecl : | test.swift:29:15:29:15 | DeclRefExpr |
8
8
| test.swift:28:18:28:21 | WriteDef : | test.swift:29:15:29:15 | DeclRefExpr |
9
+ | test.swift:33:12:33:19 | CallExpr : | test.swift:37:15:37:29 | CallExpr |
9
10
nodes
10
11
| test.swift:6:19:6:26 | CallExpr : | semmle.label | CallExpr : |
11
12
| test.swift:7:15:7:15 | DeclRefExpr | semmle.label | DeclRefExpr |
17
18
| test.swift:28:18:28:21 | WriteDef : | semmle.label | ParamDecl : |
18
19
| test.swift:28:18:28:21 | WriteDef : | semmle.label | WriteDef : |
19
20
| test.swift:29:15:29:15 | DeclRefExpr | semmle.label | DeclRefExpr |
21
+ | test.swift:33:12:33:19 | CallExpr : | semmle.label | CallExpr : |
22
+ | test.swift:37:15:37:29 | CallExpr | semmle.label | CallExpr |
20
23
subpaths
21
24
#select
22
25
| test.swift:6:19:6:26 | CallExpr : | test.swift:7:15:7:15 | DeclRefExpr |
23
26
| test.swift:6:19:6:26 | CallExpr : | test.swift:9:15:9:15 | DeclRefExpr |
24
27
| test.swift:6:19:6:26 | CallExpr : | test.swift:10:15:10:15 | DeclRefExpr |
25
28
| test.swift:25:20:25:27 | CallExpr : | test.swift:29:15:29:15 | DeclRefExpr |
29
+ | test.swift:33:12:33:19 | CallExpr : | test.swift:37:15:37:29 | CallExpr |
You can’t perform that action at this time.
0 commit comments