File tree Expand file tree Collapse file tree
lib/codeql/unified/internal
test/library-tests/controlflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ private module Ast implements AstSig<Location> {
4040 not n instanceof Callable and
4141 not skipControlFlow ( n ) and
4242 not skipControlFlow ( result )
43+ or
44+ n .( FunctionExpr ) .getCaptureDeclaration ( index ) = result
4345 }
4446
4547 Callable getEnclosingCallable ( AstNode node ) { result = node .getEnclosingCallable ( ) }
Original file line number Diff line number Diff line change 311311| 380 | cfg.swift:380:1:384:1 | FunctionDeclaration | 'FunctionDeclaration' |
312312| 380 | cfg.swift:380:18:380:18 | x | 'x -> y -^ Block' |
313313| 381 | cfg.swift:381:10:383:3 | Block | 'Block' |
314- | 381 | cfg.swift:381:10:383:3 | FunctionExpr | 'FunctionExpr -^ ReturnExpr' |
314+ | 381 | cfg.swift:381:13:381:22 | VariableDeclaration | 'VariableDeclaration -V z -> x -> y -^ BinaryExpr -> VariableDeclaration -V t -> "literal" -^ FunctionExpr -^ ReturnExpr' |
315315| 382 | cfg.swift:382:12:382:12 | z | 'z -^ ReturnExpr' |
316316| 386 | cfg.swift:386:1:388:1 | FunctionDeclaration | 'FunctionDeclaration' |
317317| 386 | cfg.swift:386:23:386:23 | t | 't -^ Block' |
Original file line number Diff line number Diff line change @@ -149,7 +149,6 @@ noCfg
149149| cfg.swift:358:6:358:28 | loop_with_identity_expr |
150150| cfg.swift:371:8:371:18 | getOptional |
151151| cfg.swift:380:45:380:47 | Int |
152- | cfg.swift:381:13:381:13 | z |
153152| cfg.swift:421:6:421:22 | localDeclarations |
154153| cfg.swift:468:6:468:17 | testIfConfig |
155154| cfg.swift:497:6:497:18 | testAvailable |
Original file line number Diff line number Diff line change @@ -378,7 +378,7 @@ func testOptional(c : OptionalC?) -> Int? {
378378}
379379
380380func testCapture( x : Int , y : Int ) -> ( ) -> Int { // $ noCfg
381- return { [ z = x + y, t = " literal " ] in // $ noCfg
381+ return { [ z = x + y, t = " literal " ] in
382382 return z
383383 }
384384}
You can’t perform that action at this time.
0 commit comments